It's not a secret anymore!
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 clicking on the hyperlink, a download dialog box should be displayed(Save,Open).
I had used <a href="/" target="_blank"></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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Download option in JSP
jQuery in Action, 3rd edition