- 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
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
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
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
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