Home > Software design >  How to stop Firefox 102.0 from removing the suffixes (file extensions) from the file names of files
How to stop Firefox 102.0 from removing the suffixes (file extensions) from the file names of files

Time:07-13

After updating Firefox from version 101.0 to 102.0, Firefox has started to remove the suffixes from files downloaded from one of our web applications. Again, this has never happened in any previous version of Firefox in my memory, and the web application code in question hasn't changed in like a year. Chrome and Safari continue to both retain the suffixes of the files downloaded. The Firefox 102.0 changes document does not list anything that seems applicable to this.

Why is Firefox doing this? And is there some Firefox preference or configuration that we can instruct users to alter in order to stop it?

Here are the headers the code outputs:

Content-Disposition: attachment; filename=foobar.ext
Content-Type: image/x-fits

It's not a common file type or suffix (extension), for the record. It's for specialized scientific analysis software, but the content type has long been widely recognized. The downloaded file is not compressed.

EDIT: Firefox 102.1 was released, and I'm still having this issue with this new version.

Things I've tried:

  • Changing the Content-Disposition: header to put double quotes around the filename.
  • Adding a download="foobar.ext" attribute to the <a> tag in the HTML used to download files.

Neither change improved things.

I found this thread of Firefox users reporting the same issue:
https://connect.mozilla.org/t5/discussions/downloads-missing-file-type-extension/m-p/2790

It appears to be a bug in Firefox which the Firefox developers are actively working on. Related Bugzilla issues:
https://bugzilla.mozilla.org/show_bug.cgi?id=1778322 [Meta]
https://bugzilla.mozilla.org/show_bug.cgi?id=1773907

CodePudding user response:

This is a bug in Firefox 102:

https://bugzilla.mozilla.org/show_bug.cgi?id=1773907

I just verified that the Firefox developers fixed it in the Firefox Nightly build dated 2022-07-12, and I think the bug fix will be included in the Firefox 104.0 release.

  • Related