Open Bug 345148 Opened 18 years ago Updated 2 months ago

Firefox obeys file extension and not known MIME type for "Open With" in file downloads

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect

Tracking

()

People

(Reporter: 32768, Unassigned)

References

()

Details

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060718 BonEcho/2.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060718 BonEcho/2.0b1

When downloading a file called something.txt which is a ZIP file and has a MIME type of application/zip, the download window says:

You have chosen to open
  file.txt
which is a: Text Document

It shows an "Open With" option which shows my text editor: "PSPAD Editor" which is associated with .txt files.

This behaviour would be acceptable if the MIME type application/zip were unknown.  Then the file extension can be used instead.  However, application/zip is a known file type.

There seems to be no possible way, from the server point of view, to send a ZIP file with MIME type application/zip and filename "file.txt" and have Firefox offer to open it in my ZIP application.

Reproducible: Always

Steps to Reproduce:
1. Go to http://entropymine.com/jason/testbed/mime/zip/file.txt (MIME type application/zip)
Actual Results:  
Firefox suggests opening the file in my text editor and gives no option to open it in my ZIP application.

Expected Results:  
Firefox should suggest opening the file in my ZIP application.

Perhaps, in this case where both the MIME type and file extension are known, Firefox might want to offer BOTH options in the "Open With" drop-down.  So the default application would be my ZIP application but my text editor could also be an option.

I am assuming this is a Windows only bug but I don't know.
This seems to work correctly however when an action is set to be always executed (e.g. in my case it downloads the file as all application/zip files and doesn't display it in the browser as all text/plain files).
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #1)
> This seems to work correctly however when an action is set to be always
> executed (e.g. in my case it downloads the file as all application/zip files
> and doesn't display it in the browser as all text/plain files).
> 

Yes, fact firefox wants to download it rather that display it inline is coming from the MIME type which is the correct behaviour.  However, what is shown in the download window is coming from the file extension which is the incorrect behaviour.

I forgot to mention - I tested this with "Ask me where to save every file" selected in the prefs.

However, the same problem seems to be occurring for me with "Save all files to this folder:" selected.  So that pref doesn't seem to be having any effect, which I guess is a separate bug.
Attached file test.txt
file to test the mimetype registration
Attached file test.rtf
test for mimetype registration
Attached file test.pdf
test for mimetype registration
Verified with 1.5.0.6 on MacOS.

For example, you have a CGI Perl script for downloading files on your webserver which does not set the MIME filename. All files then will be delivered for example as "download.cgi" to the browser. Now consider that CGI script offers the files test.rtf and test.pdf for download. The first download of test.rtf works as you can register file type ".cgi" (MIMEtype application/rtf) with a text editor. The next download of test.pdf now wants to start your text editor for file type ".cgi" and you have no way to enter any MIMEtype registration for application/pdf in Firefox with file suffix .cgi.

I tried to verify the bug with this Bugzilla instance and the test-attachments above. However, this Bugzilla instance correctly sets the mime filename, so it cannot be reproduced on this page.
 
Product: Firefox → Toolkit
As far as I can tell, this has been "fixed". In fact, I just filed bug 1485915 about said misfeature.

("Open File" being rendered useless because downloads served as application/octet-stream (eg. Patreon attachments) open in wxHexEditor on my system, regardless of what they actually are, and .zip files I save as .cbz still opening in file-roller rather than Comix.)
Severity: normal → S3
Attachment #9385158 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: