X
Tap here to go to the mobile version of the site.

Support Forum

Is there a way to display PDF file on firefox without the file getting downloaded?

Posted

Hi,

I am using an iframe to render a PDF file on firefox. The file gets downloaded in C:\Users\xxx\AppData\Local\Temp folder and the downloaded file is opened by the PDF reader and is not visible inside the browser window.

Is there any way to restrict the file from being opened by PDF reader and to show it in the browser window itself (the way its is displayed on chrome browser) ?

I am using below code to render in browser: <iframe style="margin-top:10px;" src="' + ArtifactfilePath + '#toolbar=0" width="100%" height="100%" id="iFramePdf" #zoom="200" frameborder="1"></iframe>

ArtifactfilePath is the filepath.

Hi, I am using an iframe to render a PDF file on firefox. The file gets downloaded in C:\Users\xxx\AppData\Local\Temp folder and the downloaded file is opened by the PDF reader and is not visible inside the browser window. Is there any way to restrict the file from being opened by PDF reader and to show it in the browser window itself (the way its is displayed on chrome browser) ? I am using below code to render in browser: <iframe style="margin-top:10px;" src="' + ArtifactfilePath + '#toolbar=0" width="100%" height="100%" id="iFramePdf" #zoom="200" frameborder="1"></iframe> ArtifactfilePath is the filepath.

Chosen solution

That is not possible, only when the builtin Firefox PDF Viewer is used then the file won't be downloaded to the temp folder (but will still be downloaded and stored in the cache). Files that are passed to an external application are always saved to the temp folder.

Read this answer in context 2

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17267 solutions 156047 answers

Firefox opens a PDF file in a tab only if the server sends this file as application/pdf. Any other type or a generic type will Firefox show the download (open with) dialog.


Firefox opens a PDF file in a tab only if the server sends this file as application/pdf. Any other type or a generic type will Firefox show the download (open with) dialog. ---- *Display inline https://addons.mozilla.org/firefox/addon/display-inline/ *Content-Type Fixer https://addons.mozilla.org/firefox/addon/content-type-fixer/

Question owner

Hello,

Thanks for your reply.

My doubt is not yet resolved :(

How can we block the PDF from being downloaded in tmp file?

Hello, Thanks for your reply. My doubt is not yet resolved :( How can we block the PDF from being downloaded in tmp file?
cor-el
  • Top 10 Contributor
  • Moderator
17267 solutions 156047 answers

Chosen Solution

That is not possible, only when the builtin Firefox PDF Viewer is used then the file won't be downloaded to the temp folder (but will still be downloaded and stored in the cache). Files that are passed to an external application are always saved to the temp folder.

That is not possible, only when the builtin Firefox PDF Viewer is used then the file won't be downloaded to the temp folder (but will still be downloaded and stored in the cache). Files that are passed to an external application are always saved to the temp folder. *https://support.mozilla.org/en-US/kb/view-pdf-files-Firefox

Question owner

Thank you! My query is resolved.

Thank you! My query is resolved.