adobe reader 无法打开 a.pdf,因为它不是受支持的文件类型或文件已损坏(例如,它作为电子邮件附件发送且未正确解码)打开时显示此错误在 php 中下载 pdf 文件。我使用了以下代码:
header('Content-disposition:attachment;filename=customer_acc_info_form.pdf');
header('Content-type:application/pdf');
readfile('bo_account/customer_acc_info_form.pdf');
<li><a href="customer_acc_info_form.php">Customer Account Information Form</a></li>
最佳答案
您应该删除 <li>...</li>
来自 PHP 文件。它将被附加到 PDF 文件的末尾(在 readfile 调用之后)并导致其无效。确保文件之后没有发送任何其他内容。
关于php - 无法读取 pdf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6327153/