This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
Onsite offers in IT companies Vs MNCs
WA #1.....word association
enterprisse portal matket ...mtree
do companies keep record of interviewee
SCJP, what next?