Today, I faced a problem that I could not upload my archive file with gzip format on Firefox, even it worked on Chrome. I was using macOS. My application had a setting to whitelist accepted files. I’ve already added "application/gzip" to that list. "It’s strange!", I thought.
I finally figured out that my uploaded file's type actually was "application/x-gzip" on Firefox. I also asked my colleagues to check their uploaded files on Window and Ubuntu. Hmm… they were totally different! It was "application/x-compressed" on Window, and was "application/x-compressed-tar" on Ubuntu.
In fact, gzip is already standardized by IANA. There is a note in RFC-6713 as below:
"Some applications have informally used media types such as application/gzip-compressed, application/gzipped, application/x-gunzip, application/x-gzip, application/x-gzip-compressed, and gzip/document to describe data compressed with gzip. The media types defined in this document should replace those media types in future applications."
As you can see, the difference of media types among browsers still persists as of this writing. That was the root cause!
Therefore, I had to added all media types including "application/zip,application/x-gzip,application/x-compressed,application/x-compressed-tar" in my app's whitelist.