Closed Bug 470514 Opened 14 years ago Closed 13 years ago

Make it possible to select "Always save this file" for downloads sent with Content-Disposition: attachment

Categories

(Toolkit :: Downloads API, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: Gavin, Assigned: cbartley)

Details

(Keywords: verifyme)

Attachments

(1 file)

We shouldn't remember helper app actions for these files, for the reasons explained in the comments linked to from bug 453455 comment 9, but offering to persist the "Save" choice shouldn't be a problem (see bug 453455 comment 5).
Flags: blocking1.9.2?
Summary: Make is possible to select "Always save this file" for downloads sent with Content-Disposition: attachment → Make it possible to select "Always save this file" for downloads sent with Content-Disposition: attachment
After reading through several bugposts trying to find my issue i finally found this one and being a "normal" user id just like to let you know that this is a major pain the behind for alot of us mere mortals.

I shouldnt think post examples etc is needed here as this so called bug (which i found out isnt a bug) has been discussed since before ff 2.0 was released (if im not mistaken)..


Suffice it to say that it would be nice to be able to auto-open a torrent/nzb/whatever file here regardless of what the website tells the browser, as long as I , the user, has told it to do so.. Or make it so that a user, like me, can tweak the program via some menus to do what i want.
(In reply to comment #1)
> Suffice it to say that it would be nice to be able to auto-open a
> torrent/nzb/whatever file here regardless of what the website tells the
> browser, as long as I , the user, has told it to do so.. Or make it so that a
> user, like me, can tweak the program via some menus to do what i want.
That's bug 453445, which is RESOLVED WONTFIX for reasons stated in that bug.  Please do not try and morph this bug into something that it isn't.
Huh? This has nothing to do with that. My comment stands and is based on the title of this bug regarding Content-Disposition:Attachement and various filetypes.

As long as I, the user, tells the program to open said filetype in a specific program, firefox should obey me. Or someone should make a possibility for users to make it do so. 

(im thinking you are linking to the wrong bug tho, fix your link and i will make another reply if its needed. )
Sorry - I meant bug 453455, which you would find in comment 0.
Flags: blocking1.9.2? → blocking1.9.2+
Taking this bug.
Assignee: nobody → cbartley
Flags: wanted1.9.2+
Flags: blocking1.9.2-
Flags: blocking1.9.2+
If we get a file with "Content-Disposition: attachment" we show the dialog seen in attachment 403340 [details].

This dialog basically boils down to two radio buttons and one checkbox, like so:

  ( ) Open with [ some application ]
  ( ) Save File

  [ ] Do this automatically for files like this from now on.


As I understand it, we don't want to persist the "Open with" option for reasons explained in the linked bugs and comments.

We can persist the "Save File" option, however.

So from a UI standpoint, we can disable the checkbox and its label whenever the "Open with" radio button is selected, and enabled it when "Save File" is selected.

I'm not clear on how we should persist the "Save File" option.  From the wording, it's clear that we don't want to automatically save the file for all attachment files, only those files of the same type as the original file.  I presume type to mean the MIME type as well.  So we need to persist "always save file" flags per-MIME type.  But do we have an easy way to do this?  Obviously a single boolean pref is not going to cut it.
(In reply to comment #7)
> I'm not clear on how we should persist the "Save File" option.  From the
> wording, it's clear that we don't want to automatically save the file for all
> attachment files, only those files of the same type as the original file.  I
> presume type to mean the MIME type as well.  So we need to persist "always save
> file" flags per-MIME type.  But do we have an easy way to do this?  Obviously a
> single boolean pref is not going to cut it.
We already handle this for non-attachment downloads.  We just change something in mimeTypes.rdf AFAIK.
It turns out that it's already possible to select "Always save this file" for attachment downloads.  It works as far back as Firefox 3.0.11; I'm not sure when it was actually implemented.  I did a little research with hg blame and came up empty.  There are a lot of patches that might have caused the change, but it's not actually clear which one it actually was.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Could we maybe have a test written for it then so this bug can not regress?  I'm not aware that this ever got fixed.
Keywords: verifyme
(In reply to comment #10)
> Could we maybe have a test written for it then so this bug can not regress? 
> I'm not aware that this ever got fixed.

Can you point me to an existing test that's similar to what we'd need here?
The sad part is I don't think we have one.  Basically, you'll need to have a page that forces an attachment download, and make sure the UI is never shown.  The best way to determine if it were opened may be to re-implement the service that nsHelperAppDialog implements (http://mxr.mozilla.org/mozilla-central/source/uriloader/exthandler/nsIHelperAppLauncherDialog.idl).  If show is called, the test fails.  If it isn't, you should make sure the file gets saved.
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.