wood burning stoves 2.0*
The moose likes Servlets and the fly likes How to set the default file name shown when trying to save PDF opened in inline view from browser ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to set the default file name shown when trying to save PDF opened in inline view from browser ?" Watch "How to set the default file name shown when trying to save PDF opened in inline view from browser ?" New topic
Author

How to set the default file name shown when trying to save PDF opened in inline view from browser ?

Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Hi All,

I have a website with links to PDF files. When a user clicks on the link, it should open the PDF in the browser.
But when the user clicks on the save button, I want a different name to be populated by default in the "Save As" dialog box.

Currently, it gives the entire URL (with some characters like : and / replaced by _) as the default file name.

Below is the code snippet I am using:



However, if I set the content-disposition to attachment, it pops up a dialog box with the name that I want to save. Here, if I click on Open it opens the PDF and then on trying to save the name that I want is shown by default.

Is there any other header that I need to set so that it works in the inline mode ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the default file name shown when trying to save PDF opened in inline view from browser ?