I have an iframe on my website that loads a PDF file :
<iframe src="file.pdf" frameborder="0" width="800" height="600"></iframe>
But it's downloaded automatically , I want to view the file not to download it .
So how could I fix this problem?
You need to tell your server to send that file as application/pdf ("PDF")
...
Bonus titbits:
- why do you have a PDF on a website? The web page you're displaying your PDF from already displays things PDF files display
- why are you loading a PDF in an iframe/etc. if you just want it to be downloaded? Why not just link to it
尝试使用embed <embed src="file_url" height="" width="">
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.