我正在从原始二进制数据创建一个 PDF 文件,它运行良好,但由于我在我的 PHP 文件中定义的标题,它会提示用户“保存”文件或“打开方式”。有什么办法可以将文件保存在本地服务器上的某个地方http://localhost/pdf
吗?
以下是我在页面中定义的标题
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Transfer-Encoding: binary");