Greetings -
The short answer is:
servletOutputStream.setContentType( "image/gif" );
This should be a FAQ, but it is not in either of the FAQs I'm aware of:
http://www.purpletech.com/java/servlet-faq/
http://wwwusers.imaginet.fr/~lse/JSS/textes/servfaq.htm
Jason Hunter's execellent Java Servlet Programming book has very good
examples. I would recommend buying the book if you are serious about
servlets. Check out:
http://www.servlets.com/jsp/buy.html
Finally, the web site to go along with the book contain examples that
might be useful:
http://www.servlets.com/jsp/examples/ch06/index.html
Good luck,
- Paul Philion
PS: Anyone what to update their FAQ?
PPS: Has anyone done a Java/servlet-based version of the Faq-O-Matic?
(i.e. Automatic FAQ generation written in Java and servlets)?
Javeed Akthar wrote:
>
> Hi,
>
> i would like to know how to write images to the browser from servlets.
> i mean
> when u r writing text, u say
>
> servletOutputStreamobj.setContentType ("text/html")
>
> same way what is the content type for .gif files ?
>
> and do we use servletOutputStreamobj.println ( ) for writing image data
> ?
>
> Thanks in advance.
>
> Regards,
>
> Javed
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
S/MIME Cryptographic Signature