Note: Modifying how your browser handles MIME types can be dangerous.Īgain, this addon may or may not work in all cases.From version 19 Mozilla Firefox has introduced an interesting new feature for Windows, Linux, Mac and Android: the integrated PDF viewer which will allow you to read PDF files without downloading or opening them with other programs or plug-ins. Here is a Firefox addon that can be set to listen for, and rewrite Content-Type headers based on their content.
This is what you see when your browser requests the PDF file you are attempting to view.Ĭontent-Type: application/pdf is what you would probably need if you wanted to view this file in your browser, or at least have Firefox understand what the file is and how to handle it correctly. Content-TypeĪ webserver can respond to a request for a document with the Content-Type header to describe the type of document it is returning to the browser.Ĭontent-Type: application/octet-stream is defined as "arbitrary binary data" and is basically only downloadable as a file, the browser won't know what to do with it otherwise. It also allows you to specify websites that should and should-not use this rewrite.Īs with most addons, your mileage may vary. Technically, it intercepts Content-Disposition: attachment Headers and rewrites them on the fly to Content-Disposition: inline. Here is a Firefox addon that will take Attachment headers and replace them with Inline headers:
HTTP Headers Content-DispositionĪ webserver can respond to a request for a document with the Content-Disposition header to describe how the browser should receive the file.Ĭontent-Disposition: Attachment will tell the browser that it should download the file, rather than process it as it normally would.Ĭontent-Disposition: Inline will tell the browser that it can be displayed inside the webpage, or as the webpage.
I have not yet found a way to work around this, but since the real cause of your problem lies below, I haven't researched it entirely. Generally this is used when you need to take an automatically generated document name and present it as something nice for the user. This attribute on an anchor tag will attempt to force your browser to download the file instead of processing it in the way it normally would. There are several ways that sites can force your browser to download a file instead of opening it directly: The download HTML Attribute view-source:), I just get the raw ASCII text displayed of the Pdf file. I added view-source: to the beginning of the Pdf's location (i.e.Firefox just attempts to download the "binary file". I tried the answer from How to call firefox built-in pdf viewer (pdf.js) manually?, but to no avail.If I were to ever encounter this annoyance again, instead of downloading the file, can I force Firefox to open a file (online or otherwise) in its default Pdf viewer? So Firefox can only assume that it is a "binary file". I'm assuming the web-server is " not telling" Firefox that this Pdf file is, in fact, a Pdf file. It describes the file as a "binary file", even though the file is a Pdf that I can download and view natively. With this specific Pdf that I found online, I click the link to its location, and Firefox brings up the download dialog. Normally, when I attempt to open a Pdf file, Firefox displays it in its default Pdf viewer (called pdfjs, I believe). I'm trying to view a Pdf file that I found online.