Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to Force internet Explorer Always to ask save file prompt, also downloading pdf and also with some reader installed.
Someone knows what registry settings works for this purpose? Or any other solution?
Thanks

What I have tried:

i need this working on webbrowser, i tried to add "Content-Type: application/pdf; Content-Disposition: attachment; filename=\"prova.pdf\"" in the navigating event
Posted
Updated 23-Mar-17 23:16pm

1 solution

Send your file with the content type "application/octet-stream" rather than "application/pdf". That way the browser will always treat it as a basic binary file and the only options it will give are to open or save.

Also as a basic rule "forcing IE to...." is never a solution for any problem. Your website can never override browser functionality, and what if they are not using IE but some other browser? There are usually ways to tackle these issues but trying to restrict the browser in its functionality is never one of them.
 
Share this answer
 
Comments
Member 3395794 25-Mar-17 11:45am    
Hi thanx, i explain better my problem:
i'm working with webbrowser in c#, in this situation i must download some pdf files, (i dont explain now why i dont use webclient etc etc...) so the problem is that when i start the download the pdf is opened inside the browser or opening the reader, instead i need that starting the save file prompt.
The link does no have the explicit url (referred to file), so i also tried to add header content-disposition:attachment in the navigate method but it doesnt work, so i thought that one solution could be find the manner to say ie to show the prompt always, ...maybe with the appropriate registry key?

Any other solution would be appreciated.
Thanx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900