wood burning stoves 2.0*
The moose likes Servlets and the fly likes Urgent-servlet response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Urgent-servlet response" Watch "Urgent-servlet response" New topic
Author

Urgent-servlet response

Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
How to send a response as binary file or image?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

obtain a binary stream from the response rather than a writer, set the response mime type, pipe the data.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
and never attempt to mix different content types in a single outputstream or you're bound to get a huge mess.
The number of times we've had to explain that to people is too large to count.


42
Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
There is an url repesenting image in database. I want to fetch the url and then pass that as an image to client
response.setContentType("image/gif")
OutputStream out= response.getOutputStream()
But how to send that to client?
do i need to use GifEncoder? if yes then how?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent-servlet response
 
Similar Threads
WA #1.....word association
Onsite offers in IT companies Vs MNCs
enterprisse portal matket ...mtree
do companies keep record of interviewee
SCJP, what next?