Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

Firefox download .csv files as .json

more options

Some time in the last month or so Firefox has started downloading .csv files as .json. I need the files in .csv format so I can work with them in Excel. These are large files I don't want to deal with the trouble of converting them every time. I've started using Chrome just so the files download correctly. I can't find any setting to change to make .csv the default again.

Some time in the last month or so Firefox has started downloading .csv files as .json. I need the files in .csv format so I can work with them in Excel. These are large files I don't want to deal with the trouble of converting them every time. I've started using Chrome just so the files download correctly. I can't find any setting to change to make .csv the default again.

Izabrano rješenje

Thank you for the example.

I clicked the Tables button and tried a download. I was promised five six files (first screenshot), which could only mean it would be a compressed archive like a ZIP file. When I check the details of the server response on the download (second screenshot), they named the file with a .zip extension but they erroneously identified it as a JSON file. So Firefox (un)helpfully changed the file extension from .zip to .json (sigh).

This is the new behavior I mentioned earlier that is going to change in Firefox 85 because too many sites are sending mixed signals. So for now, instead of renaming .json files with a .csv extension, they should be renamed with a .zip extension either during or after saving.

Alternately... I have an add-on that can override the erroneous content-type automatically when sites have specified a .zip extension. It's this one, and you turn it on by clicking the Zzzz button it adds to the toolbar:

https://addons.mozilla.org/firefox/addon/content-type-fixer/

Even if it's only going to be useful to you until Firefox 85 is released, maybe it's worth a try?

Pročitaj ovaj odgovor u kontekstu 👍 1

Svi odgovori (4)

more options

I am still downloading .csv files as such. On one site I click on a downloader provided by the website, on another I right-click the file and select "save link as". I download other types of files as well, all without any issue.

more options

Firefox 84 has a feature to "correct" certain file extensions to match the type of file the server says it is. So in the case of the CSV files, it's possible -- although it would be very weird -- that the site is identifying the file using the content-type application/json instead of text/csv (or other CSV-specific content-type). That's going to be turned off in Firefox 85, but for now, that's one possible explanation.

In that case, simply renaming the file extension from .json to .csv will work around the issue because Firefox isn't changing the internal format of files when it changes the extension. Can you check that?

If you are actually getting a JSON file from the site instead of CSV, hmm, maybe there's something wrong with the format selection feature of the site. Can you give more information about what site has this problem?

Note: if you share a URL, please break it by inserting a space before the .com. Otherwise, your reply will be delayed in appearing because links trigger spam moderation.

more options

I'm downloading the files from the Census Bureau https://data.census.gov /cedsci/advanced. I've attached a screenshot of the download menu. It says the files should be .csv but they download as .json. They should download as a zipped folder with the .csv files inside. They still download this way with Chrome. There is no menu to change the file type before the download starts and I choose to either save the file or open it.

more options

Odabrano rješenje

Thank you for the example.

I clicked the Tables button and tried a download. I was promised five six files (first screenshot), which could only mean it would be a compressed archive like a ZIP file. When I check the details of the server response on the download (second screenshot), they named the file with a .zip extension but they erroneously identified it as a JSON file. So Firefox (un)helpfully changed the file extension from .zip to .json (sigh).

This is the new behavior I mentioned earlier that is going to change in Firefox 85 because too many sites are sending mixed signals. So for now, instead of renaming .json files with a .csv extension, they should be renamed with a .zip extension either during or after saving.

Alternately... I have an add-on that can override the erroneous content-type automatically when sites have specified a .zip extension. It's this one, and you turn it on by clicking the Zzzz button it adds to the toolbar:

https://addons.mozilla.org/firefox/addon/content-type-fixer/

Even if it's only going to be useful to you until Firefox 85 is released, maybe it's worth a try?

Izmjenjeno od jscher2000 - Support Volunteer