我用这个下载50M的文件问什么只有前面一部分呢?
   Header("Content-type: application/octet-stream");   
   Header("Accept-Ranges: bytes");   
     /* Header("Accept-Length: ". $size); */ 
Header("Accept-Length:   ".filesize("2.rmvb")); 
   Header("Content-Disposition: attachment; filename=" . "Test.rmvb");    $file   =   fopen("2.rmvb","rb");   //   打开文件    
$perSize = 1024 * 1024;
while (!feof($file)) 
{
   echo fread($file, $perSize);
} fclose($file); 

解决方案 »

  1.   

    有幾種可能,檢查以下php.ini相關項的設置max_execution_time  =  600 ;每个PHP页面运行的最大时间值(秒),默认30秒max_input_time = 600 ;每个PHP页面接收数据所需的最大时间,默认60秒memory_limit  = 128M ;每个PHP页面所吃掉的最大内存,默认8M
      

  2.   

    在文件前加上set_time_limit(0);否则默认30秒后断开。如果你的网速不是太快的话我想30秒是下不完50m的吧?