下記のようなダウンロード処理を使用しています。
lang
1if (file_exists($hoge_file)) { 2 header('Content-Description: File Transfer'); 3 header('Content-Type: application/octet-stream'); 4 header('Content-Disposition: attachment; filename='.basename($hoge_file)); 5 header('Content-Transfer-Encoding: binary'); 6 header('Expires: 0'); 7 header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); 8 header('Pragma: public'); 9 header('Content-Length: ' . filesize($hoge_file)); 10 ob_clean(); 11 flush(); 12 readfile($hoge_file); 13 exit; 14} 15
ローカルサーバーで200MBのファイルまでは扱えるようにしようと思っているのですが、
このコードを実行しようとすると、173KBしかダウンロードされません。
いろいろ試したのですが(ob 関数を使ったりreadfileの代わりに freadを使ったり)大きいファイルのダウンロードができないんです。
環境はPHP 5.3でApache 2.2を使っています。
大きいファイルに対するPHP設定は問題ないはずです(実行タイム、メモリリミットなど)
どうすれば良いのかご教示願います。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。