We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

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

了解更多

When I ask to save a file, the save dialog box in Firefox deletes the file extension (e.g., "doc", "pdf", "ofx") from the filename. I am using version 66.0.2

more options

When I ask to save a file, the save dialog box in Firefox deletes the file extension (e.g., "doc", "pdf", "ofx") from the filename. I am using version 66.0.2

The same file download works in chrome.

When I ask to save a file, the save dialog box in Firefox deletes the file extension (e.g., "doc", "pdf", "ofx") from the filename. I am using version 66.0.2 The same file download works in chrome.

被選擇的解決方法

Are you generating something like this:

Content-Disposition: attachment;filename="Test Widget Rename.json";

You could double-check that Firefox received it using the Network Monitor, if the download opens in the same tab. Note that the monitor doesn't start logging until you open it:

  • "3-bar" menu button > Web Developer > Network
  • (menu bar) Tools > Web Developer > Network
  • (Mac) Command+Alt+e
  • (Windows) Ctrl+Shift+e

When you click the request for the download, the Response Headers usually are displayed in the right side by default but, if another panel is selected, click Headers.

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

所有回覆 (6)

more options

Hi LearningAboutTech, that definitely shouldn't happen. Is that the only part cut off?

A known issue is that Firefox stops at the first space in the file name if the site didn't put quotation marks around it when sending it. Most sites do it right, but there are some exceptions. But any space in the name usually would be way before the file extension, so that may be unrelated.

Does it help to set Finder to show all file extensions? In Finder, click the Finder menu, then Preferences, then on the Advanced panel, check the box for "Show all filename extensions".

more options

Hi JSCHER - Thank you for you reply. The server is owned by me - yes the file name from the server looks like "Test Download" ( double quotation marks around filename).

The extension(.json) is still missing. I would want the extension to be showed to make the experience across browsers the same.

more options

選擇的解決方法

Are you generating something like this:

Content-Disposition: attachment;filename="Test Widget Rename.json";

You could double-check that Firefox received it using the Network Monitor, if the download opens in the same tab. Note that the monitor doesn't start logging until you open it:

  • "3-bar" menu button > Web Developer > Network
  • (menu bar) Tools > Web Developer > Network
  • (Mac) Command+Alt+e
  • (Windows) Ctrl+Shift+e

When you click the request for the download, the Response Headers usually are displayed in the right side by default but, if another panel is selected, click Headers.

more options

Hi - Yes using the content disposition header. The file is being downloaded in a seperate tab and hence I am not sure how can I can inspect in a seperate tab.

``` response.setHeader(PlatformService.Constants.CONTENT_DISPOSITION,"attachment;filename=" + fileName + ".json");```

more options

(Sorry, no markdown here. You can use <pre> and </pre> around blocks you don't want to wrap, or <code> and </code> to use a monospace font but allow wrapping.)

response.setHeader(PlatformService.Constants.CONTENT_DISPOSITION, "attachment;filename=" + fileName + ".json");

Is that Node, or Java, or .Net, or ???

You need more quotation marks inside your quotation marks. If you can use ' interchangeably with " then try this:

response.setHeader(PlatformService.Constants.CONTENT_DISPOSITION, 'attachment;filename="' + fileName + '.json"');

If your language or style guidelines don't allow using ' in place of " then use whatever method of escaping you need to achieve the same effect.

Success?

more options

That helped - Thank you for your time!