$file = fopen($filePath, "r"); // 打开文件 // 输入文件标签
if ($file) {
Header("Content-type:application/pdf");
Header("Accept-Ranges: bytes");
Header("Accept-Length: " . filesize($filePath));
Header("Content-Disposition: attachment; filename=" . $fileName); // 输出文件内容
echo fread($file, filesize($filePath));
fclose($file);
}
php 下载pdf
最新推荐文章于 2024-04-24 14:07:16 发布