X
Tap here to go to the mobile version of the site.

Support Forum

Firefox changes file extension when downloading

Posted

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

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

Installed Plug-ins

  • 20-20 3D Viewer for IKEA - Mozilla Plug-In v5.0.94.1
  • 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
  • 5.1.40416.0
  • NPWLPG

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

More Information

guigs 1072 solutions 11697 answers

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 New Fx Menu , click Help Help-29 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".

SafeMode-Fx35

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.

Please first make sure that all of these settings are the way the should be: *[[Change what Firefox does when you click on or download a file]] 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. [[Troubleshoot Firefox issues using Safe Mode|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 [[Image:New Fx Menu]], click Help [[Image:Help-29]] 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'' <br>(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". ;[[Image:SafeMode-Fx35]] '''''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.

Question owner

Hi,

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.

Regards, jaktrip

Hi, 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. Regards, jaktrip
cor-el
  • Top 10 Contributor
  • Moderator
17535 solutions 158559 answers

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:

Try to rename (or delete) the mimeTypes.rdf file in the Firefox profile folder to reset all file actions. *http://kb.mozillazine.org/mimeTypes.rdf *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_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) *http://kb.mozillazine.org/Profile_folder_-_Firefox

Question owner

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.

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.
cor-el
  • Top 10 Contributor
  • Moderator
17535 solutions 158559 answers

Try to ask advice at the Stack Overflow forum site.

Try to ask advice at the Stack Overflow forum site. * http://stackoverflow.com/questions/
FredMcD
  • Top 10 Contributor
4259 solutions 59631 answers

Attention Sumos, I have seen several posts with the same problem.

Attention Sumos, I have seen several posts with the same problem.

Question owner

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.

http://stackoverflow.com/questions/28874759/force-firefox-not-to-change-file-extension

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. http://stackoverflow.com/questions/28874759/force-firefox-not-to-change-file-extension
FredMcD
  • Top 10 Contributor
4259 solutions 59631 answers

Can you post a public link to a web page?

Can you post a public link to a web page?
cor-el
  • Top 10 Contributor
  • Moderator
17535 solutions 158559 answers

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.

  • HKEY_CLASSES_ROOT\.xxx

You can check the linked MIME type in the MIME Database registry key.

  • HKEY_CLASSES_ROOT\MIME\Database\Content Type\
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. * HKEY_CLASSES_ROOT\.xxx You can check the linked MIME type in the MIME Database registry key. * HKEY_CLASSES_ROOT\MIME\Database\Content Type\
jscher2000
  • Top 10 Contributor
8770 solutions 71713 answers

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:

filetype:DOCX site:microsoft.com - Bing

What about PDF files from other sites? None of them save with the extension, or is the problem only in the app?

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: [http://www.bing.com/search?q=filetype%3ADOCX+site%3Amicrosoft.com&form=OSDSRC filetype:DOCX site:microsoft.com - Bing] What about PDF files from other sites? None of them save with the extension, or is the problem only in the app?