搜尋 Mozilla 技術支援網站

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

了解更多

Excel download

  • 8 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 tfodor

more options

When I download an Excel fike from my own website (for example: https://www.tfodor.hu/pareto-diagram-excel.php Download = Letöltés) the attached image appears. The file is being downloaded. This is not the case with Edge and Chrome.When you download an Excel file from another webpage, you are asked to save or open it.

When I download an Excel fike from my own website (for example: https://www.tfodor.hu/pareto-diagram-excel.php Download = Letöltés) the attached image appears. The file is being downloaded. This is not the case with Edge and Chrome.When you download an Excel file from another webpage, you are asked to save or open it.
附加的畫面擷圖

被選擇的解決方法

Then I guess you cannot edit your webserver configuration, so you should contact their support with your issue.

從原來的回覆中察看解決方案 👍 0

所有回覆 (8)

more options

Ez a konkrét eset a weboldal hibájából fakad, ugyanis a webkiszolgáló nem tölti ki a „content-type” HTTP-fejlécet, amely a fájl MIME-típusát tartalmazná (XLSX esetén egyébként application/vnd.openxmlformats-officedocument.spreadsheetml.sheet értéket kellene tartalmaznia).

In English: The current issue is caused by the website itself, the web server does not fill the „content-type” HTTP header, which would contain the MIME type of the file (for XLSX the correct MIME type would be application/vnd.openxmlformats-officedocument.spreadsheetml.sheet).

由 Balázs Meskó 於 修改

more options

Unfortunately, this did not solve the problem. Content-Type is optional and this error has not occurred before. I tried, but nothing changed.

more options

What have you tried exactly? Content-Type is indeed not mandatory, but it SHOULD be set (all caps, meaning the RFC says so). Even Chromium complains that the Content-Type is invalid, it just detects the actual MIME type through MIME sniffing.

more options

Thank you for your help. I placed in the head the next: <meta http-equiv="content-type" content="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"> For this nothing changed. Firefox on my iPhon can open this Excel file correctly.

more options

First of all: Firefox for iOS is actually a skinned Safari, so it behaves differently than "normal" (Gecko-based) Firefox.

That meta tag is not valid, and it also does not make much sense. You don't need to set Content-Type at a HTML file, but in the HTTP headers. So to fix this issue, I'd need to know what web server do you use.

由 Balázs Meskó 於 修改

more options

My webpage is on Hostinger server.

more options

選擇的解決方法

Then I guess you cannot edit your webserver configuration, so you should contact their support with your issue.

more options

Thanks for the help! I finally found the solution on the internet. I enclose the two links that can help others if they run into this problem: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Configuring_server_MIME_types https://htaccessbook.com/useful-htaccess-rules/