搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

CSV-file downloaded with PDF-extension

more options

Hi, I'm running into an issue where when I download a CSV-file from a website it's downloading as a pdf when it should be downloading as a csv. If I after the download rename the file back to the csv-extension, I can open it in Excel. Any ideas? I run Linux on my laptop.

Hi, I'm running into an issue where when I download a CSV-file from a website it's downloading as a pdf when it should be downloading as a csv. If I after the download rename the file back to the csv-extension, I can open it in Excel. Any ideas? I run Linux on my laptop.

所有回覆 (2)

more options

What site is this?

有幫助嗎?

more options

This could occur if the website mistakenly identifies the file as a PDF using

Content-type: application/pdf

However, that would be pretty strange. It's more common for websites not to have any specific Content-Type (also known as MIME Type) for CSV files, and to identify them either as plain text or as generic binary content.

Occasionally sites will improvise a Content-Type that Firefox has seen before and associated with a different file extension, and this *could* cause Firefox to wrongly assume that the download's file extension needs to be corrected. You can turn off the file extension fix-up feature for non-media files and see whether that makes any difference. Here's how:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

More info on about:config: Configuration Editor for Firefox. The moderators would like us to remind you that changes made through this back door aren't fully supported and aren't guaranteed to continue working in the future.

(2) In the search box in the page, type or paste browser.download.sanitize_non_media_extensions and pause while the list is filtered

(3) Double-click the preference to switch the value from true to false

Then test the download again and see whether Firefox preserves the exact file name assigned by the site.

Did that make any difference?

有幫助嗎?

問個問題

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題