Link to *always* show Open/Save dialog
843841Jan 21 2005 — edited Feb 22 2005A servlet forwards to a JSP page. In this page there is a link to a file.
I want that, when the user left-clicks the link, the Open/Save dialog box is always displayed, regardless of whether the MIME type of the file is a known one or not.
The browser should never try to directly open the file; it should always ask "Open/Save?".
How do i do that ?
I tried to set the "content-disposition" header of the Response to "attachment; filename=[myFileName]" in the servlet that forwards to the page containing the link, but this seems to make a download window appear already when sending the page to the browser, before any user's intervention.
Instead, i'd want that the page is sent normally to the browser which will normally display it, and the Open/Save dialog should only appear when the link is left-clicked.