Previously with IE, when I left click on the link, I am given a choice of either opening or saving the pdf file. The file name and extension is shown very clearly
However with Firefox, I get this message 'YOU HAVE CHOSEN TO OPEN (FILE NAME.. no extension) which is a application/octet-stream. What should Firefox do with this?' I am given an option to either save it or open it but unable to tick the checkbox 'Do this automatically for files like this from now on' . It is blanked off. The way I see it Firefox does not recognise the file type, until I select the pdf reader manually. Alternatively, when I open the webpage in IE within Firefox, it works perfectly.
Where is the problem? I use Firefox 3.0 and PDF X-Change viewer. I also have Adobe Reader 9, which is my second-preference due to its sluggishness
I'm using Firefox 41.0.1 on Fedora 22.
I noticed this behaviour when I was trying to open a PNG image link on a GitLab site. The server replies with 'Content-Disposition:'inline; filename='logo.png'
and Content-Type:'application/octet-stream'
.
I want it to either display the image on the browser, or offer me to open it on the system default image viewer. I know it is possible, at least in Windows. See the GIF below kindly provided by @JourneymanGeek:
I made some tests using this tool and, apparently, when I click a link and the response headers contains the application/octet-stream
mime type, Firefox offers me to open the file using gedit, stating it's the default application.
Trade barbs, banter and body blows with over 130 foes, and earn help from fighting friends along the way! Build words and battle monsters to survive three storybooks with 10 chapters each. The walls of fiction are collapsing as characters run wild through the Great Library, and only Lex the Bookworm can save the world from certain doom in Bookworm Adventures 2! The better the word, the badder the damage - so advance your word power with over 20 powerful treasures, including all-new Rainbow tiles. Stop the presses! Bookworm adventures deluxe full version.
- If I download the file (in this case, a PNG image) and double-click on it, it opens on Eye of Gnome.
xdg-open
also opens it in Eye of Gnome.application/octet-stream
isn't present on/usr/share/applications/defaults.list
$ grep 'gedit' /usr/share/applications/defaults.list
returns onlytext/plain=org.gnome.gedit.desktop
- I have removed the
~/.mozilla/firefox/<profile>/mimeTypes.rdf
file and the issue persits. - I have also removed the
~/.local/share/applications/mimeapps.list
file and the issue still persists. - I have restarted Firefox and logged out of my Gnome profile as well.
Here's the Firefox file association screen:
So, again, my question is: is it possible to have Firefox either display the file on the browser (if it is a file it's able of rendering), or offering the correct application able of rendering it (if there's one on the system)?
Or does the server declaring the incorrect mime-type renders it all impossible?
Also, why is it thinking gedit
is the default octet-stream
handler? Is this correct?
3 Answers
I have also removed the ~/.local/share/applications/mimeapps.list
file and the issue still persists.
There is likely another mimeapps.list
elsewhere on the system. You can go through the list here, or search through your system with one of the following commands:
or
Check for any application/octet-stream
entries in those, and either comment them out or remove them.
Well, seems that Firefox will not fix this issue but I fixed it in my way removing the application/octet-stream=org.gnome.gedit.desktop
from my ~/.config/mimeapps.list
and using the add-on OpenDownload² to provide me the Run
option.
If the extension of the file being downloaded is correctly configured in the mimeapps.list
, firefox will open (run) it like a charm.
@Bob answered part 2 of the question: how to control which app opens the file.
The answer to part 1 is: Firefox downloads all files of type application/octet-stream by design. According to the HTTP standard, a compliant browser MUST NOT second-guess the server if a content-type is specified. Since octet-stream files contain arbitrary data, the browser should download them.
Most browsers ignore the standard in favor of user friendliness. Firefox does not. As stated in @Geyslan's answer, you would need to use a 3rd party extension to circumvent this design choice.
Not the answer you're looking for? Browse other questions tagged linuxfirefoxfedoragnomemime-types or ask your own question.
I am new to Firefox, after having been very long with IE. I have this problem where I cannot open PDF files in the browserPreviously with IE, when I left click on the link, I am given a choice of either opening or saving the pdf file. The file name and extension is shown very clearly
However with Firefox, I get this message 'YOU HAVE CHOSEN TO OPEN (FILE NAME.. no extension) which is a application/octet-stream. What should Firefox do with this?' I am given an option to either save it or open it but unable to tick the checkbox 'Do this automatically for files like this from now on' . It is blanked off. The way I see it Firefox does not recognise the file type, until I select the pdf reader manually. Alternatively, when I open the webpage in IE within Firefox, it works perfectly.