我有一个发送ZIP文件的脚本。这是一个12MB的大文件,但有时候,在极少数情况下,下载停止在4MB,5MB,6.5MB(从不相同)......
<?php
$fullpath = 'foobar.zip';
header('Content-Description: File Transfer');
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename=' . $fullpath);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '. filesize($fullpath));
ob_clean();
flush();
readfile($fullpath);
exit();
?>
readfile()在读取所有文件之前可以在什么条件下停止?还有什么不对吗?