How do I force files to open in the browser instead of downloading (PDF)?

后端 未结 13 1117
别跟我提以往
别跟我提以往 2020-11-22 04:15

Is there a way to force PDF files to open in the browser when the option \"Display PDF in browser\" is unchecked?

I tried using the embed tag and an iframe, but it o

相关标签:
13条回答
  • 2020-11-22 05:18

    If you are using HTML5 (and I guess nowadays everyone uses that), there is an attribute called download.

    For example,

    <a href="somepathto.pdf" download="filename">
    

    Here filename is optional, but if provided, it will take this name for the downloaded file.

    0 讨论(0)
提交回复
热议问题