【发布时间】:2013-11-01 05:07:32
【问题描述】:
我的代码如下。这可行,但我想知道是否有办法排除“打开”按钮并强制用户保存文件。谢谢!
<?php
header("Content-disposition: attachment; filename=myfile.pdf");
header("Content-type: application/pdf");
readfile("myfile.pdf");
?>
【问题讨论】:
-
没有。那是浏览器选项而不是 http 标头。你有没有去过一个你有保存但没有打开选项的网站?