wood burning stoves
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Download option in JSP" Watch "Download option in JSP" New topic

Download option in JSP

Shakti Misra

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.

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
It's not a secret anymore!