PHP脚本服务文件在几秒钟后停止

时间:2014-09-21 08:24:48

标签: php

我有一个小的PHP脚本,它提供文件。只是一个简单的下载服务器。

我使用以下代码:

$mm_type="application/octet-stream";
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: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary\n");
readfile($path); // outputs the content of the file
exit();

我在10-15秒后停止下载文件。当我重试下载文件时,完全停在相同的文件大小。例如,文件是4GB,它停止下载230MB,当我重新开始下载时,它再次完全停止在230MB。

脚本有什么问题?

0 个答案:

没有答案