This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Sending image from servlet using standard java io Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending image from servlet using standard java io" Watch "Sending image from servlet using standard java io" New topic
Author

Sending image from servlet using standard java io

Inderpal Singh
Greenhorn

Joined: Dec 05, 2005
Posts: 2
Hi All,

I want to send an image (gif file) from servlet to client browser using standard java io. I have a file object with me, which is nothing but a complete path of image. I am setting the contentType to image/gif and have tried so many things but didn't get through. So thought of writing in the forum.

I would appreciate if someone provide me answer for the above question as it is little bit urgent. Thanks in advance!

Cheers,
Inderpal Singh
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Check out this example of sending image data kindly provided by Ben Souther.
Bill
Inderpal Singh
Greenhorn

Joined: Dec 05, 2005
Posts: 2
Thanks Bill. I will try and post if I face any problems.....

Regards,
Inderpal Singh
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sending image from servlet using standard java io