Firefox changes file extension when downloading
We are building a web based application where you can download different kinds of files, e.g. PDF and DOCX files. Direct links are provided to these.
In Chrome, IE, Opera - all of the files download as expected (or open up if there is a specific setting for that type of file). Not so with Firefox.
Upon clicking, a dialogue opens and asks if the file should be downloaded or opened. In this dialoge, no file extension is displayed. Opening the file works both for docx and pdf with MS word and Acrobat Reader installed. Fine.
But downloading is strange: the file is downloaded, but in case of the PDF, the file extension is cut off (missing completely!). In case of the docx file, firefox downloads the file with a .doc extension! If I manually correct the extensions, all is OK. Why does Firefox mess around with the file extensions of downloaded files? Can it be turned off or fixed without losing compatibility to other browsers? Using Win7 and ffx 38.0.5
Additional System Details
- 20-20 3D Viewer for IKEA - Mozilla Plug-In v184.108.40.206
- ActiveTouch General Plugin Container Version 105
- Adobe PDF Plug-In For Firefox and Netscape 11.0.06
- Advanced web conferencing functionality.
- Google Update
- NPRuntime Script Plug-in Library for Java(TM) Deploy
- Next Generation Java Plug-in 10.40.2 for Mozilla browsers
- Office Authorization plug-in for NPAPI browsers
- The plug-in allows you to open and edit files using Microsoft Office applications
- Shockwave Flash 17.0 r0
- User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Please first make sure that all of these settings are the way the should be:
Next please make sure it is not a malicious add on or extension and check to see if this also happens in Firefox Safe Mode:
Try Firefox Safe Mode to see if the problem goes away. Firefox Safe Mode is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
- Click the menu button , click Help and select Restart with Add-ons Disabled.
If Firefox is not running, you can start Firefox in Safe Mode as follows:
- On Windows: Hold the Shift key when you open the Firefox desktop or Start menu shortcut.
- On Mac: Hold the option key while starting Firefox.
- On Linux: Quit Firefox, go to your Terminal and run firefox -safe-mode
(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
When the Firefox Safe Mode window appears, select "Start in Safe Mode".
If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems article to find the cause.
To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.
When you figure out what's causing your issues, please let us know. It might help others with the same problem.
I have the same issue if I restart Firefox in safe mode. I have tested with multiple computers and different Firefox profiles - all have the same behaviour.
It is also independent of the download actions. The files ARE downloaded, but the file extension is cut off.
Try to rename (or delete) the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
You can use this button to go to the currently used Firefox profile folder:
- Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
This is going in the wrong direction. We are a software developer. Our website must function with different browsers. It doesn't help if we can fix this issue with one particular Firefox installation. It must work for our clients.
As said, we have tested our website with the newest Firefox, Chroma, IE, Opera on multiple computers. Chrome, IE and Opera work fine. Firefox cuts off the file extensions when downloading the files. All of the 3 Firefox installations we tested, also in safe mode, with the default mime type settings in place after a fresh install.
The problem may be in our html/angularJS code OR in the standard Firefox package, NOT in specific settings.
I begin to believe it is a AngularJS problem. However all other browsers (chorme, IE, Opera, Safari) work fine.
Try to ask advice at the Stack Overflow forum site.
Attention Sumos, I have seen several posts with the same problem.
I have been browsing stack overflow and what I get is the confirmation that it is indeed a Bug in Firefox, and there seems to be no remedy.
Can you post a public link to a web page?
This would normally only happen if there is a problem with the mimeTypes.rdf or with the MIME database key in the Windows registry.
You can Inspect the MIME database with the registry editor (regedit.exe) and do a search for that MIME type (file extension) via Ctrl+F. Be cautious with editing the registry as there is NO UNDO possible: all changes are applied immediately. You can export key(s) in the registry editor before making changes. You can check specific file extension keys (e.g. .jpg) in the registry with the registry editor.
You can check the linked MIME type in the MIME Database registry key.
- HKEY_CLASSES_ROOT\MIME\Database\Content Type\
This seems like a different issue than .bat and .reg files, which are fairly uncommon for serving over the web and so possibly defaulted to a text/plain content type.
Can you reproduce the error with DOCX files from other sites, such as Microsoft? Here are some samples:
What about PDF files from other sites? None of them save with the extension, or is the problem only in the app?