PDF下载,而不是链接查看/下载 [英] PDF to download, not link to view/download

查看:90
本文介绍了PDF下载,而不是链接查看/下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做到这一点,当你点击在这里下载一个pdf文件将下载到用户的桌面。我应该如何去做这件事? 使用 Content-Disposition 表头。



但是,请:只有在用户真正需要 时才需要下载PDF并且不打开它(这样它只是为用户提供的帮助,他不必明确选择保存文件)。不要用它强制用户下载它,尽管他只是想查看它。


I am trying to make it so when you click "download here" a pdf file will download to the user's desktop. How should I go about doing this?

解决方案

Use the Content-Disposition header.

But, please: Only do this if it is really necessary for the user to download the PDF and not open it (so that it’s just an aid for the user that he does not have to explicitly select "save file"). Don’t use it to force the user to download it although he just wants to view it.

这篇关于PDF下载,而不是链接查看/下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆