手册中readfile例子
$file = '12.jpg';if(file_exists($file)){ header('Content-Description: File Transfer'); header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile($file); exit();}
如果说 ob_clean(); 清除缓冲区,用的还有点道理的话
那么 flush(); 推出输出缓冲区,就没有道理了
因为无论如何,输出缓冲区中的内容都要被输出的
重新换了一本手册,原来手册的例子都是用户email给官方的
再照版主这么一说,手册不严谨也是正常的
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号