Browse to the PDF file you'd like to view or download and click it. The file should automatically open in the browser window. To save (download) the PDF, click the icon. Internet Explorer users. Similar to Microsoft Edge, Internet Explorer displays PDF files by default, instead of offering to download them for you. A "view" link, which would point directly to the file and open in the browser, and a "download" link, which would open a download dialog box. If there was the above .htaccess file in that dir. would the "view" links open a download dialog instead of the browser just opening the pdf? Would the php solution allow both links? How to Download a PDF File forcefully instead of opening it in a Browser using JS. Docs » General » How to Download a PDF File forcefully instead of opening it in a Browser using JS I have set it to "Use PDF-XChange Editor (default). Now files open in that program, however it still always asks me if I would like to save or open the file, even though I have selected "Do this automatically for files like this from now on". Note that from most websites, the PDF just open without asking if I want to save or open. So here’s a simple snippet for when you want to force a download of a file (such as a PDF, .doc etc), when a link is clicked. The default action will open the document in the either the same browser window, or in a new tab/window by using the usual target methods: Open file in … Continued On my most recent assignment I was faced with the challenge of downloading a pdf file from an API and displaying it in the browser. Normally, the API would provide a json-object with a link to the pdf, which can then be used to open a new browser tab/window and the browser or platform takes care of the rest.
With a bit more work, you can change PDF Download to meet your particular needs. In Firefox: Go to Tools—PDF Download Options; Instead of the pop-up option window, you can set a different behavior. This is useful when you know you will need to open several PDFs outside the browser: Although PDF Download offers PDF to HTML conversion, I found