Hello

I am writting a servlet, and I Have an image file (as gif or png) under
my filesystem.

I want read this binary file, and send to the web browser.

When I read this image file with the followed code, I don't receive it
inside my browser.
                       response.setContentType("image/png");
                      PrintWriter out = new
PrintWriter(response.getOutputStream());
                       FileInputStream in = new
FileInputStream("chart.png");
                       byte b;

                       while ( in.available() > 0) {
                         out.print(in.read());
                       }

                       in.close();


Do you have an idea about it

Thank in advance
begin:vcard
n:;[EMAIL PROTECTED]
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;14624
fn:[EMAIL PROTECTED]
end:vcard

Reply via email to