最佳答案
我想强制浏览器下载一个 pdf
文件。
我使用以下代码:
<a href="../doc/quot.pdf" target=_blank>Click here to Download quotation</a>
它使浏览器在一个新的窗口中打开 pdf,但我希望当用户点击它时,它能下载到硬盘上。
我发现 Content-disposition
用于此,但是如何在我的案例中使用它呢?