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

搜尋 Mozilla 技術支援網站

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

了解更多

Firefox not handling downloads from many Web sites

more options

Some time ago, many banking and other financial Web sites began to offer only one dual option: "View/Download". The Web site then performs a function depending on the Web browser's settings. Unfortunately, the Firefox "Files and Applications" settings don't seem to allow for this dual-option icon.

For example, in my case, this usually involves PDFs. Most often I just want to view the file and then decide if I want to save it. Or, I know that I only want to view the file and don't want to save it. If "Always Ask" is selected in the browser and you click the "View/Download" icon, the Web site asks you if you want to open the file or save it. If we ask to open it, the Web site also downloads it in the background. If we select to save it, the file is saved without our being able to view it.

If I set the PDF file type in Firefox to "Adobe Acrobat", then then Firefox opens the PDF in Acrobat where I can view it and also saves it in the background to the download location set in Firefox. This results in a lot of time being spent going to the download location and deleting a list of unwanted downloads. When I finally realized that this was happening, I had a huge list of unwanted files.

No option allows us to view without downloading. Is there a way to fix this? Thx

Some time ago, many banking and other financial Web sites began to offer only one dual option: "View/Download". The Web site then performs a function depending on the Web browser's settings. Unfortunately, the Firefox "Files and Applications" settings don't seem to allow for this dual-option icon. For example, in my case, this usually involves PDFs. Most often I just want to view the file and then decide if I want to save it. Or, I know that I only want to view the file and don't want to save it. If "Always Ask" is selected in the browser and you click the "View/Download" icon, the Web site asks you if you want to open the file or save it. If we ask to open it, the Web site also downloads it in the background. If we select to save it, the file is saved without our being able to view it. If I set the PDF file type in Firefox to "Adobe Acrobat", then then Firefox opens the PDF in Acrobat where I can view it and also saves it in the background to the download location set in Firefox. This results in a lot of time being spent going to the download location and deleting a list of unwanted downloads. When I finally realized that this was happening, I had a huge list of unwanted files. No option allows us to view without downloading. Is there a way to fix this? Thx

所有回覆 (1)

more options

I apologize that the following is long, but I wanted to provide some more background and options for opening PDFs.

Step #1: Switch to the Open in Firefox option

Firefox can't display PDFs without downloading and saving them somewhere. This option is the only one that uses the web content cache instead of the Downloads folder or Temp folder.

Step #2: Force PDFs to save in the web content cache

If web servers don't specify how Firefox should handle a PDF, or if they specify "inline" handling, then then Firefox loads the PDF as web content with its original URL in the address bar. The PDFs are saved with other cached web content, not in your download folder. This is good.

But web servers can try to force a download by setting Content-Disposition: attachment if they don't want browsers to show the files in a tab. Firefox changed what it does in this case:

Before Firefox 98: Firefox always showed a download dialog, even though you had already told Firefox what you wanted to do, even when you checked the box to always do this in the future. It was kind of infuriating.

Firefox 98+: Firefox downloads the file automatically and then opens it. Because these are saved to disk the URLs start with file:///. By default, they are saved in your "Save files to" folder on the Settings page.

In response to user suggestions/complaints, Mozilla added two options to modify the above:

(A) Just for PDFs, override "attachment" disposition to "inline"

When your handling action is "Open in Firefox", all PDFs can now be opened as web content and saved in the cache instead of a regular folder. Here's how you set this up:

(i) 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. I'm using this so I feel comfortable mentioning it.

(ii) In the search box in the page, type or paste browser.download.open_pdf_attachments_inline and pause while the list is filtered -- requires Firefox 103 or later

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

(B) [optional] For all the downloads Firefox saves to disk and opens automatically, change from the "Save files to" folder to the Windows Temp folder (if you made the change in #1, this will affect other kinds of files rather than PDFs)

Here's how you access it:

(i) 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.

(ii) In the search box in the page, type or paste browser.download.start_downloads_in_tmp_dir and pause while the list is filtered -- requires Firefox 102 or later

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

This would not affect files opened with inline disposition; those will still be in the web content cache.

Are we getting closer?