Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, everybody. I have a question, I use pdf viewer and show pdf file.
I showed pdf file. However, if computer installs IDM, its will auto download file and can't show file.
I want to change my code which prevent auto download, but I don't know. Have you any idea?
Thanks a lot!

What I have tried:

<object data="abc.pdf" type="application/pdf">
<embed src="abc.pdf" type="application/pdf" />
Posted
Updated 3-Oct-18 8:58am

This is how the HTTP protocol works; it is neither an MVC issue nor a PDF problem.

Basically anything that is displayed in your browser needs to be downloaded first, and then it is retrieved by the browser and displayed. You can go through the settings on your browser and find the local cache (IE likes the folder "temporary internet files"). Every image, script, or other document called for by a web page will be located there.

What is happening in your situation is that IDM is taking over as the "default viewer" for PDF files.
 
Share this answer
 
You have no control over which application on the client shows your PDF file. Whatever app/control is registered on the machine to handle the "application/pdf" mime type is the one that handles it. You cannot change that from your website code.
 
Share this answer
 

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