【发布时间】:2015-01-12 10:22:21
【问题描述】:
我尝试提供在 dwhandler.php 中处理的 pdf 文件下载。 所有这一切都应该做的是打开 pdf 文件或开始下载它。 我试过了:
<?php
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename='Paper.pdf'");
header("Cache-Control: must-revalidate");
readfile("Paper.pdf");
exit;
?>
我也尝试了其他一些标题,但没有一个有效。
浏览器不断以一些奇怪的编码直接打开文件。这是前几行的图片: http://www.directupload.net/file/d/3865/h8waniq9_jpg.htm
有人知道为什么会这样吗?我不知道还有什么可以尝试...
非常感谢!
【问题讨论】:
标签: php html pdf download readfile