0
我已经编写了下载音频文件的代码。当我尝试通过PHP下载超过50MB的文件时,它不会完全下载。它下载最多45MB。每次我尝试下载时,下载大小从36MB到45MB不等。文件未完全下载
我已经在php.ini改变了配置如下:后
memory_limit 512M
post_max_size 512M
upload_max_filesize 512M
在phpinfo()
,其显示上述值I更改配置。但我仍然有同样的问题。
我用下面的代码来下载:
<?php
$file = "file to download";
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, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
?>
帮助我解决这个
感谢
我曾经有下载问题,检查出可能包含有用信息的问题,以帮助您解决它:http://stackoverflow.com/questions/9944869/forced-file-download-iscorrupted –
如果您下载65MB文件,下载软件(浏览器或下载加速器)是否显示进度并在35MB时完成(100%)? –
好吧,我会尝试,因为你建议Ayesh Karunaratne –