Firefox file associations

Firefox file associations

Oleg Goldshmidt pub at goldshmidt.org
Thu Mar 18 14:21:42 IST 2010


Hi,

Quoted below is the original post from a thread I started back in
December. I have just found if not a solution then a workaround, so I
am posting it here in the hope that it will useful at least to
diagnose the problem if it ever happens to anyone.

On Wed, Dec 16, 2009 at 5:28 PM, Oleg Goldshmidt <pub at goldshmidt.org> wrote:
> Hi,
>
> Pardon my stupidity and confusion, I have what seems to be a rather
> simple question, but I feel lost.
>
> How can I add/modify a file/application association in Firefox? On
> Linux or on WinXP for that matter? I tried to read every FM I could
> find and the answer seems, amazingly, "you can't". It seems so basic
> that I refuse to believe there is no solution unless/until someone
> here confirms the sad state of affairs.
>
> Here is the specific problem. I want to click on a link to a CSV file
> to open it in a spreadsheet, be it OOCalc or Gnumeric or Linux, Excel
> on Windows, etc. However, Firefox (3.5.5 on both platforms) apparently
> recognizes it as a text file and cheerfully opens it itself, as plain
> text, which is not what I want. The Edit->Preferences (Tools->Options
> on WIndows) popup has an Applications tab that lists "Actions", but
> CSV is not listed and there isn't any way to add it.

There have been numerous suggestions, all were very much appreciated,
but none worked. Please don't offer any new ones without first
studying the December thread carefully.

I am now on FF 3.5.8 on Linux and 3.6 on Windows and the problem persists.

I found what the problem was, and a workaround for me. In my case, I
have control over the web server that has the files.

First, the default MIME type for the web SERVER should NOT be
text/plain. I run Apache on Linux, so I

a) added

text/csv            csv

to the proper place in /etc/mime.types,

b) changed "DefaultType" from "text/plain" to
"application/octet-stream" in /etc/httpd/conf/httpd.conf,

c) restarted httpd.

Then, on a client with Firefox I went to the profile directory
(~/.mozilla/firefox/*.default or whatever) and renamed mimeTypes.rdf.

Then started Firefox, cleared the cache and the history, clicked on a
link to a CSV file, and it prompted me for an application. Choose
oocalc, tick the "Always do it from now on" box, voila...

It worked for me only after I had done ALL of the above. E.g., just
moving mimeTypes.rdf away (or trying to add a custom CSV stanza to it)
did not work. Apparently, FF assigns a higher preference to the MIME
type coming from the server than to its own or system association
tables or anything else. Thus, if the server thinks it is text/plain
there is no way to convince FF that it is not.

Despite the fact that changing the server configuration helped resolve
the issue I insist that it is a problem with Firefox - Konqueror on
Linux and IE on WIndows did not have a problem with DefaultType
text/plain on the server. I have not investigated what they do
differently.

Hope this helps someone, anyway (well, I know it did, someone from
Switzerland who has the same problem and found the thread contacted me
off list).

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list