12 messages in com.mysql.lists.javaRe: displaying bolb on browser!!
FromSent OnAttachments
Tim Endres03 Jan 2001 20:18 
Satish plakote04 Jan 2001 07:42 
Michael Besteck-Resulta04 Jan 2001 08:25 
Mari...@amsinc.com08 Jan 2001 00:47 
Gary Bentley08 Jan 2001 01:53 
Tim Endres08 Jan 2001 11:02 
jalal ud din08 Jan 2001 23:01 
Christopher Abney11 Jan 2001 15:40 
sch...@amgt.com11 Jan 2001 16:04 
Christopher Abney11 Jan 2001 18:15 
Carlos Garcia Jurado Suarez11 Jan 2001 18:25 
Igor Fedulov11 Jan 2001 18:28 
Subject:Re: displaying bolb on browser!!
From:Tim Endres (Tim.@SecureByDesign.com)
Date:01/08/2001 11:02:16 AM
List:com.mysql.lists.java

OutputStream outputStream = response.getOutputStream(); response.setHeader("content-type","image/jpeg");

Try reversing these two lines:

response.setHeader("content-type","image/jpeg"); OutputStream outputStream = response.getOutputStream();

It may be that when the output stream is retrieved that the header lines are "fixed", although I thought that only happened when you actually wrote to the output stream.

Also, I think the suggestion to check yuor image by writing to a local file is a good idea just to make sure the image content is correct.

Finally, request the image url manually:

telnet host 80 GET /getphoto.jsp?photo_id=1 HTTP/1.0 <blank line>

to see if the header returned has the correct content-type.

HTH, tim.