Firefox keeps downloading pdf insead of opening it






















Table of Contents 1 Download actions 2 Changing download actions 3 Adding download actions 4 Resetting download actions for all content types. Note: Firefox will not be able to properly handle a file download if a misconfigured web server sends it with an incorrect Content type.

For example, Firefox may display the content as plain text instead of opening the file in an application or asking you what to do. You can contact the website in such cases or you can try a Firefox add-on such as Content-Type Fixer to work around the problem. If you decide to use an add-on and you need help with it, you should visit the add-on site or contact the add-on developer directly for support. Multiple entries for the same file format or extension?

Some file types can include more than one Internet Media type. Warning: Do not choose Firefox as a helper application to always open the file type, as this can cause a problem where Firefox repeatedly opens empty tabs or windows after you click on a link. Is Do this automatically for files like this from now on disabled? This can happen if the website's server incorrectly specifies the Internet Media type of the file.

It also can happen if the server assigns "Content-Disposition: attachment" to the file. This will remove all customized content type actions. By default, Google Chrome opens a PDF file in the browser window instead of saving it to the downloads folder. To have PDF files open in the browser again, repeat these steps and select the Preview in Firefox option or Use other option to choose another program. By default, Opera opens a PDF file in the browser window instead of saving it to the downloads folder.

To change how Opera treats PDF files in the browser, follow the steps below. Peter Mortensen Add a comment. Active Oldest Votes. Quentin k gold badges silver badges bronze badges. ColinM ColinM Taboada but then the user's system may not know the file type. Perhaps if you want to override the user's preferences then octet-stream would be the way to go, but giving the correct type and a suggested filename is the "correct" way to provide a download. So my question is should the content type be set before uploading?

And also, we get only a link from the backend team, a url that gives the file path, that we open in new tab using:window.

Kailas I don't understand what you're trying to do.. These headers have no effect on a file upload, you need to have the code behind the url set the headers every time it is downloaded by the client. ColinM Thanks buddy, you said it right, the issue when we debugged was the mime type was set while uploading the files.

This should be done by the back-end team. I tried to get codes on how to add headers in java script but was not successful. Thanks, as I got the real idea cleared from you Show 5 more comments. It uses the custom filename specified on the view side. Christophe Roussy Christophe Roussy Akshay Akshay 2, 3 3 gold badges 32 32 silver badges 70 70 bronze badges. If you have control over the server code you should use 'attachement' as this will allow to use the same filename generation code.

If you have no control over the server this is a good solution. This is a brilliant solution to the problem however, as always, IE is holding us back from using it: caniuse. Important to note that this does not work across domains e. If downloading from one domain, the download attribute will not work if content is stored on a different domain. CORS may allow that content to pass through haven't tested. Yes figured! Show 1 more comment. This is for ASP. FilePath, FileMode.

Open, FileAccess. Leon van Wyk Leon van Wyk 8 8 silver badges 7 7 bronze badges. Oops, there were typing errors in my previous post.

Andrew Barber What previous post? If you have Apache add this to the. Alexander Alexander 43 1 1 silver badge 4 4 bronze badges. Kindly suggest me. Thanks in advance. That does the opposite to what is asked for — Quentin.



0コメント

  • 1000 / 1000