See also these links:
My client requires that I display a .pdf file in an iframe and also that I provide a download link that will prompt the user with a Save-As dialog if they choose to download the file (I am aware that the .pdf viewer has a save button. The client requires the link).
The .pdf file itself is on a secure server so I use a HttpHandler to transmit the file.
The code shown below works fine to display the file in the iframe.
However, when the user clicks the download link, the .pdf simply opens in a new window and does not prompt the user with a save-as dialog as intended.
I am currently setting the ContentType to "application/pdf". I have observed that when I set the ContentType to "application/octet-stream", I am always prompted with a save-as dialog (regardless of content-disposition). However, the file the user is prompted to save is the .ashx file, not the .pdf file.
I have stepped through my code and observed that content-disposition is be
View Complete Post