为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

PDF files are saved to temp folder before opened

  • 9 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 Christian

more options

When selecting "Open in Firefox" in the "What do you want to do with this file?" box or on about:preferences and then opening a PDF file on the web, instead of downloading the file to RAM and opening it with its online address, Firefox downloads the PDF to /tmp/mozilla_${USER}0 and opens it from there. This also adds it to the download history. I have set the about:config flag browser.download.start_downloads_in_tmp_dir to true so the files I just open and don't want to permanently download don't clutter my $HOME/Hämtningar (downloads) folder. I tried to first prevent that by selecting the default action to do when tasked to open a PDF, but that didn't fix it, so I set the about:config flag. Unfortunately, setting the default action stopped Firefox from opening a PDF inline without downloading it and I cannot find any option along the lines of "Preview in Firefox" (as described in this support article ).

When selecting "Open in Firefox" in the "What do you want to do with this file?" box or on '''about:preferences''' and then opening a PDF file on the web, instead of downloading the file to RAM and opening it with its online address, Firefox downloads the PDF to '''/tmp/mozilla_${USER}0''' and opens it from there. This also adds it to the download history. I have set the '''about:config''' flag '''browser.download.start_downloads_in_tmp_dir''' to true so the files I just open and don't want to permanently download don't clutter my '''$HOME/Hämtningar''' (downloads) folder. I tried to first prevent that by selecting the default action to do when tasked to open a PDF, but that didn't fix it, so I set the '''about:config''' flag. Unfortunately, setting the default action stopped Firefox from opening a PDF inline without downloading it and I cannot find any option along the lines of "Preview in Firefox" (as described in [[How do I OPEN and read pdf docs on line rather than download, save and then read and delete. This only happens on some sites & started recently.|this support article]] ).

被采纳的解决方案

Switching from "Open in Firefox" to "Always Ask" or "Save File" and then back again still works as expected for me with your example PDF.

Backup your profile folder and try deleting the handlers.json file.

定位到答案原位置 👍 1

所有回复 (9)

more options

The support article link is somehow broken and I don't know how to edit it, so here's the working link: https://support.mozilla.org/sv/questions/985483

由Christian于修改

more options

That isn't a support article, it's a question marked as solved. It's an old question and downloading was significantly changed recently (version 98, IIRC).

Firefox has to download a file to open it. The /tmp file should be cleared by your OS at some point. You can change fstab to have /tmp open in RAM, if you have enough RAM.

more options

Terry said

[…] Firefox has to download a file to open it. […]

I am aware that it needs to download the files to open them (how else should it get the data to display?) but I mean opening it in the context of the website. Before I selected a default action for PDF files it would download the file but not to disk. It would simply load the contents into pdf.js directly from the web server and show the server's address in the address bar (instead of the local /tmp file path) and not add the file to the download history. It's that behaviour I somehow want to get back. I checked, Firefox in the current version can do that (I opened a new profile and went to my website to open the test PDF and it opened like I wanted it to open, see the first attached screenshot). In my current profile it opens as a download, see the second screenshot. I want to get back to the original behaviour but I don't seem to be able to do so, no matter what I set the setting for it to.

由Christian于修改

more options

Christian said

I opened a new profile and went to my website to open the test PDF and it opened like I wanted it to open

So there's something up with your profile. Does it still happen in Troubleshoot Mode?

more options

zeroknight sade

Does it still happen in Troubleshoot Mode?

Yes, it does. Like I said, it began when I set the default action for opening PDF files to "Open in Firefox". It would probably be nice if a dev added a "Preview in Firefox" option to that menu in about:preferences.

more options

"Open in Firefox" is the default setting for PDFs in a new profile though and you already confirmed that it works, so it must be something else with your profile.

Try resetting all the browser.download.* settings to default in about:config.

more options

zeroknight sade

Try resetting all the browser.download.* settings to default in about:config.

That doesn't seem to do anything. By the way, the "Open in Firefox" is visually selected by default, but the behaviour is different after setting it to another alternative and then back to "Open in Firefox". By the way, I already tested setting browser.download.start_downloads_in_tmp_dir to true in the new profile and the PDF file still opens exactly the way I want it to, as the setting only affects downloads and not opening without downloading to a file.

由Christian于修改

more options

选择的解决方案

Switching from "Open in Firefox" to "Always Ask" or "Save File" and then back again still works as expected for me with your example PDF.

Backup your profile folder and try deleting the handlers.json file.

more options

zeroknight sade

Backup your profile folder and try deleting the handlers.json file.

That caused Firefox to only download the file (to my downloads folder, without even asking where to put it) and not open it. Directly typing an address would open it as wanted, just opening it through a link would download and then open it, even though I was the one who made the link on dateien.lampe2020.de/show_dir.php, and I made it to only open, not force a download or anything.

Interestingly, after restoring it from my backup and setting the default action to open it now opens it without saving to a file.

由Christian于修改