wood burning stoves 2.0*
The moose likes JSP and the fly likes Setting response header through Javascript 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 » JSP
Bookmark "Setting response header through Javascript" Watch "Setting response header through Javascript" New topic

Setting response header through Javascript

Ramesh Bhagasra

Joined: Nov 21, 2003
Posts: 8
Hi guys
I have to show a file to the client using the browser, I have the file contents stored in my Blob Field in the Database. Now I want to display the file on clilck of a button called DOWNLOAD and then determine the type of file, correspondingly setting the contentType and setHeader of response object. How can i do that??? Please help me at ur earliest...
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
Your "Download" button will have to create a request to a servlet - not a JSP - because JSP are designed only to serve characters. This kind of question comes up all the time - browsing around in the servlet and JSP forums or doing a search will get you lots of hits. Or you could even buy a book.
Don't get me started about those stupid light bulbs.
subject: Setting response header through Javascript
Similar Threads
Help with File download
mime type in web.xml
Ajax.Updater not displaying
STRUTS - Remebering page access after login
was admin server couldn't start