在浏览器中打开文件而不是下载 [英] Opening files in browser instead of downloading
本文介绍了在浏览器中打开文件而不是下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个PDF文件的href链接,点击它下载。
I have a href link to a pdf file that when clicked on it downloads. I want this to just open in a new page instead of downloading.
<a href="../file/1012">clicking here</a>
我曾看过一个使用iframe来做这件事的网站,但我不希望使用它。
I've had a look at a website that does this with iframe, but I would prefer not to use that.
推荐答案
add target =_ blank得到一个新窗口。添加.pdf可能会有所帮助。如果您可以控制主机Web服务器,则调整相关文件的标头也可以帮助它以内联方式打开。我可以告诉你,如果你也可以设置什么标题
add target="_blank" to get a new window. adding .pdf may help. If you have control over the host web server adjusting the headers for the files in question will also help it open inline. I can tell you what headers to set if you are able too
这篇关于在浏览器中打开文件而不是下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文