File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Setting response header through Javascript" Watch "Setting response header through Javascript" New topic
Author

Setting response header through Javascript

Ramesh Bhagasra
Greenhorn

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...
Thanx
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
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.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting response header through Javascript