Do this automatically for files like this..., checkbox is disabled

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-27, 03:08

Operating system: Windows 10
Browser version: 33.1.0
32-bit or 64-bit browser?: 64

When I want to download a CSV file, the Do this automatically for files like this from now on option is disabled. Is there a way to enable this?

When I look in the Preferences on the Applications tab, there is no mention of CSV files or Excel, so is there somewhere else that I should be looking, so I can set the behaviour to always happen when Opening/Saving a file, or have that checkbox enabled?

Image

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 955
Joined: 2021-01-26, 11:18

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Kris_88 » 2024-05-28, 08:17

"do this automatically for files like this from now on" is disabled most of the time:
https://bugzilla.mozilla.org/show_bug.cgi?id=647633

Make "do this automatically for files like this from now on" work even with "content-disposition: attachment"
https://bugzilla.mozilla.org/show_bug.cgi?id=453455

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-28, 08:38

Kris_88 wrote:
2024-05-28, 08:17
"do this automatically for files like this from now on" is disabled most of the time:
https://bugzilla.mozilla.org/show_bug.cgi?id=647633

Make "do this automatically for files like this from now on" work even with "content-disposition: attachment"
https://bugzilla.mozilla.org/show_bug.cgi?id=453455
Thanks for the links with the discussion (I am still reading the second one, it is quite long). I tried my best to follow the logic of why:
It's only disabled for application/octet-stream files.
and I think I understand what is being argued, but it still feels unsatisfying.

I see that there may be a solution (if it really bothers me) by learning more about mime types and how they are set in Windows?
However, I have determined that I can edit the mime types outside of Firefox to fix the problem by creating false mime entries, but it shouldn't be necessary to be forced to use external programs to edit these files. It should be settable from inside the app.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35892
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Moonchild » 2024-05-28, 09:01

Ultimately it is a server misconfiguration. The server needs to send correct MIME type information, and not designate it as a "downloadable generic attachment". If it sends a "generic binary" format then the browser can't assume the type will be the same next time a file with the same generic binary MIME type is being sent. You can use kludges to work around it, maybe, but what really needs to be done is the webmaster/server operator needs to make sure the files that are downloaded have the correct MIME/content type information sent along it in the response headers.
"content-disposition: atachment" should really only be used if a webmaster wants to force "download as a file" for normally internally-viewed formats for a web browser, e.g. html or jpg files that should be downloaded, not viewed in the browser (i.e.: "I don't care if you support this format yourself or not; treat it as an attachment/downloadable").

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-28, 09:59

So I have read enough comments in the second link and @Moonchild's reply to appreciate that the issue is a combination of servers not being configured properly and the intentions of RFC 2183.

And I take consolation in the length of the discussion on the Bugzilla thread as evidence that I am not unique or eccentric in thinking that something is less than ideal.

One observation in the discussion that struck me as persuasive is that RFC 2183 was developed and addresses the context of email messages, not web browsers, and so a strict following of The Attachment Disposition Type may not be necessary for Firefox, (and by extension Pale Moon).

But I understand the current behaviour won't change, and so, unlike a few participants in the Bugzilla thread I am not going to jump ship to Chrome (or another browser with a different way of handling poorly configured servers) because of it.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 955
Joined: 2021-01-26, 11:18

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Kris_88 » 2024-05-28, 10:32

Still, it’s interesting to know exactly what mime type the server returns. You could look at the http headers in the "network" tab in the developer tools.

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-28, 10:47

Image

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 955
Joined: 2021-01-26, 11:18

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Kris_88 » 2024-05-28, 10:53

Clear...
Thank you.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 955
Joined: 2021-01-26, 11:18

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Kris_88 » 2024-05-29, 03:27

suzyne wrote:
2024-05-28, 10:47
In general, this is a strange decision - to prohibit the checkbox specifically for type "application/octet-stream".
At the same time, for the “application/download” type, the checkbox is allowed and the question “what to do” is asked, although the “download” action should have worked here without any questions, based on common sense...

However, there is a solution.

1) You can download the example file and turn on the "do this automatically ..." checkbox.
https://www.dwsamplefiles.com/download- ... ple-files/
This will create an entry in the file "mimeTypes.rdf" for the type "application/download".
You will be able to see this entry in settings Preferences -> Applications.

2) Next, you close the browser and edit the file "mimeTypes.rdf", replacing
"application/download" substrings with "application/octet-stream".

3) You can check "application/octet-stream" example here and edit the required action in your browser settings (Preferences -> Applications).
https://filesamples.com/formats/bin

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-29, 04:46

Kris_88 wrote:
2024-05-29, 03:27
However, there is a solution.
Very clever. The mimeTypes.rdf file looks interesting, indeed.

I did the steps, and they worked as you describe, and then to be sure I visited my banking site (where this question all began), generated a new download file of some transactions, and the resulting CSV file downloaded without extra steps.

Thanks so much!

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35892
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Moonchild » 2024-05-29, 11:38

Kris_88 wrote:
2024-05-29, 03:27
In general, this is a strange decision - to prohibit the checkbox specifically for type "application/octet-stream".
No it is not. I already briefly tried to explain this above.

What MIME type a server sends is the primary mechanism by which a browser (or other client) knows what file type the attempted retrieved file is. Other things like content sniffing (usually blocked) or file extensions are secondary/tertiary mechanisms that yield to a MIME type header if one is sent.
"application/octet-stream" is the generic fallback for when the server doesn't know what type the file is and how it is intended to be processed (either by the server or the client).
Most beginning webmasters have run into this as one point or another when setting a webserver up from scratch.
The issue is that, because application/octet-stream is a generic fallback, you must not associate that with any program. After all, the next time a server has an unconfigured file type, it would then default to what the user chose the first time.

For example: you visit server A. it has a .csv file on it but that isn't registered as a MIME type in the server. The user would choose to open the link with a certain program (e.g. excel), and then click the checkbox. What happens now? Every application/octet-stream file after that encountered on the web would now launch excel, because of the MIME type association created.
Then you visit server B. It has a similar issue only this time .pdf files don't have a MIME type set. The server sends the pdf file with application/octet-stream as a fallback and the browser launches, that's right, excel to open that PDF. That is NOT the kind of setup you want, neither as a user, nor as someone trying to help that user fix it.

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-29, 11:55

For me I just like to download the "not sure what type of file this is" content, and I am not trying (or want to open) the CSV files in Excel, so it is nice to have the option of always saving without being asked if I want to open it every time.

The dialogue that prompts for the location for the save still appears, so if I get second thoughts, I can always cancel the download.

And because I am not asking to always open the file in an app, I can't imagine any downside with this work around which I am happy with, while still accepting that Pale Moon has to work the way it does by default.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35892
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Moonchild » 2024-05-29, 12:17

suzyne wrote:
2024-05-29, 11:55
so it is nice to have the option of always saving without being asked if I want to open it every time
That would be fine if all you ever do is visit the one site, but like I said, if you visit a similarly incompletely configured website later it doesn't make sense to assume you want to save all unknown files of any type everywhere, forever. After all, once you have selected that option you will exclude being able to open it in a program of your choice.

Sablesword
Hobby Astronomer
Hobby Astronomer
Posts: 20
Joined: 2017-04-01, 06:50

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Sablesword » 2024-05-29, 16:20

Moonchild wrote:
2024-05-29, 11:38

What MIME type a server sends is the primary mechanism by which a browser (or other client) knows what file type the attempted retrieved file is. Other things like content sniffing (usually blocked) or file extensions are secondary/tertiary mechanisms that yield to a MIME type header if one is sent.
"application/octet-stream" is the generic fallback for when the server doesn't know what type the file is and how it is intended to be processed (either by the server or the client).
Trying to understand this:

If the MIME type is the generic "application/octet-stream" then PM will fall back to the extension when offering the default program should the user choose to open the file rather than saving it. Correct?

If the MIME type is (e.g.) for a pdf, but the extension is .csv, then what default program does PM offer? The default for .pdf or the default for .csv?

If PM falls back to the extension when offering a default program to open a generic "application/octet-stream" MIME type file, then why is it a bad and to be avoided thing for PM to likewise fall back to the extension for the "always open/always save" treatment of a generic MIME type, instead of the generic MIME type overriding the extension?

Is it a matter of wanting to avoid tricky programming needed to handle different "always do this" choices for "application/octet-stream - extension .csv" vs "application/octet-stream - extension .pdf" vs "... - extension .doc" vs "... - extension .somethingelse"? Whereas offering a default program type based on falling back to the extension is easy programming?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35892
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Moonchild » 2024-05-29, 17:04

Sablesword wrote:
2024-05-29, 16:20
If the MIME type is the generic "application/octet-stream" then PM will fall back to the extension when offering the default program should the user choose to open the file rather than saving it. Correct?
Correct, afaik. Been a while since I looked at the code in question but i'm pretty sure if the MIME type is generic it's one of the cases where file extensions and content sniffing might be used.
Sablesword wrote:
2024-05-29, 16:20
If the MIME type is (e.g.) for a pdf, but the extension is .csv, then what default program does PM offer? The default for .pdf or the default for .csv?
PDF. MIME type > file name
Sablesword wrote:
2024-05-29, 16:20
why is it a bad and to be avoided thing for PM to likewise fall back to the extension for the "always open/always save" treatment of a generic MIME type, instead of the generic MIME type overriding the extension?
I already explained this twice now. I don't know how else to explain it. "Always open/save" creates an association with the MIME type in question. if that type is the generic/fallback default, it will always kick in regardless of file name or file content (if sniffing is allowed). You can't have both that association and at the same time not have it.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 955
Joined: 2021-01-26, 11:18

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Kris_88 » 2024-05-29, 17:10

Moonchild wrote:
2024-05-29, 11:38
No it is not. I already briefly tried to explain this above.
Moonchild, I understand what you're saying, but I don't see a fundamental difference between "application/octet-stream" and "application/download". In both cases, we are not given exact information about the file and anything can be hidden behind these types. So it doesn't make sense to associate a specific application with these types, but it still makes sense to associate a "save to disk" action with them.

And, by the way, you can always go to the settings (preferences->applications) and change the saved action (including you can select “always ask” and get a standard dialog with a question).
Therefore, a complete ban on saving an action for a specific type seems strange.

And I can say for myself that I almost never open a file with a third-party application directly from the browser. I always save to disk and then open it. If I have any doubts, then before opening I look at the file using a hex viewer.

User avatar
suzyne
Lunatic
Lunatic
Posts: 425
Joined: 2023-06-28, 22:43
Location: Australia

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by suzyne » 2024-05-29, 20:30

Kris_88 wrote:
2024-05-29, 17:10
And I can say for myself that I almost never open a file with a third-party application directly from the browser
That is my workflow too.

Since I started using Pale Moon, I can't think of a single instance when I haven't wanted a copy of the original file from a website on my disk before opening it?

If I stumble across more sites that are poorly configured, having their files in my Downloads folder is precisely what I will be wanting and not an inconvenience.

So, I am thankful for the workaround @Kris_88 supplied because for me, it has improved the way Pale Moon works.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 670
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Lucio Chiappetti » 2024-05-29, 21:35

I quite often donwload data files or pdf documents, often wanting to save them in a location of my choice. I never used nor liked a single "Download" location ( I have "always ask me where to save" ticked).
I never fully liked the way Pale Moon (and actually Firefox before it ... so it's a Mozilla inheritance I suppose) handles the association between MIME type and application (is this RDF ?) ... I'd like some command line way to edit it like I use to do with .mailcap and mime.types with my mail user agent (alpine). Actually there there is an option to override the MIME type with the file extension (it prompts you for permission to do it, it does not do it automatically), to cope with bad information by the sender (could be the same for4 badly configured web sites).

My RDF for PDF has multiple MIME types although I could not reproduce how I got it
pref.png
When I click on it I obtain this popup
menu.png
which has multiple viewer applications (atril and acroread). I switch between them because atril is lighter as a viewer, but I prefer the file navigation menu of acroread to choose the location (apparently the navigation depends on the viewer, not on Pale Moon) ... I mean I select acroread then Save

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35892
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Do this automatically for files like this..., checkbox is disabled

Unread post by Moonchild » 2024-05-30, 01:14

Kris_88 wrote:
2024-05-29, 17:10
Moonchild, I understand what you're saying, but I don't see a fundamental difference between "application/octet-stream" and "application/download".
application/octet-stream is the default fallback type. application/download is not, and is set explicitly.

Post Reply