aspose file tools*
The moose likes Servlets and the fly likes Download option in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Download option in JSP" Watch "Download option in JSP" New topic
Author

Download option in JSP

Shakti Misra
Greenhorn

Joined: Sep 13, 2005
Posts: 2
Hi All
I am facing a problem in downloading option in a JSP page. My jsp page display list of files(any extension) with hyperlink.now clicking on the hyperlink, a download dialog box should be displayed(Save,Open).
I had used <a href="/a.zip" target="_blank">a.zip</a>. But it's work with all types of file except .txt,.bmp,.html(those file are recognised by browser).

Can any one suggest me whenever i click on any file link , it should display Save,Open dialog box not to display the contents of the file on the browser window.
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
There is content type called Content-disposition.
http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index3.html


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Download option in JSP
 
Similar Threads
Big binary file interactive downloading
Downloading from JSP
to provide download link
how to download or view the "Excel FILE "i n IE browser
JSP: DownLoad a file