Re: image download

2008-09-27 Thread Johnny Kewl
- Original Message - From: "Dave" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Saturday, September 27, 2008 3:38 AM Subject: Re: image download InputStream is = new FileInputStream("/apphome/pictures/image.jpg"); OutputStream os = respon

Re: image download

2008-09-26 Thread T . K . Thiyagarajan
My code given below works fine. U can try if u want public void sendImageFile(HttpServletResponse response) { FileInputStream in=null; File f = null; try { f = new File("webapps/Plasma/graphs", "image.gif"); in = new FileInputStream(f

Re: image download

2008-09-26 Thread Konstantin Kolinko
2008/9/27 Dave <[EMAIL PROTECTED]>: > For http://domain.com/servlet/pictures/image.jpg"/> > > in servlet get method, > > InputStream is = new FileInputStream("/apphome/pictures/image.jpg"); > OutputStream os = response.getOutputStream(); > > byte[] buffer = new byte[256*1024]; //256k > while (true

Re: image download

2008-09-26 Thread Dave
e(); os.close(); --- On Fri, 9/26/08, Dave <[EMAIL PROTECTED]> wrote: From: Dave <[EMAIL PROTECTED]> Subject: image download To: "Tomcat Users List" Date: Friday, September 26, 2008, 6:33 PM For http://domain.com/servlet/pictures/image.jpg"/>   in servlet get met

image download

2008-09-26 Thread Dave
For http://domain.com/servlet/pictures/image.jpg"/>   in servlet get method,   InputStream is = new FileInputStream("/apphome/pictures/image.jpg"); OutputStream os = response.getOutputStream();   byte[] buffer = new byte[256*1024];  //256k while (true) { int n = is.read(buffer);      if (n < 0