次のコードを使用して、約 920MB のファイルをダウンロードしました。
set_time_limit(0);
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("X-Sendfile: $zipname"); // For Large Files
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=\"".$zipname."\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($directory_location . '/' . $zipname));
ob_end_flush();
readfile($directory_location . '/' . $zipname);
このコードの前に、次のリンクUsing X-Sendfile with Apache/PHP、Streaming a large file using PHPおよびLimit download speed using PHP を使用していくつかの調査を行いましたが、ファイルのダウンロードにはまだ時間がかかるため、あまり役に立ちません (2MB)ファイル。転送速度などは表示されません。ダウンロードを開始して、すべてのファイル (大または小) で約 60Kbps のファイルを提供したい
更新:実行中のダウンロードプロセスが表示されず、しばらくしてポップアップを表示して場所を選択し、保存ボタンを押した後、ダウンロードプロセスウィンドウなしでコンピューターに直接保存することに気付きました:(