失敗我有一個小腳本,設置標題強制zip文件的下載與:大拉鍊下載只能在IE
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
header("Pragma: public");
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Description: File Transfer");
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="'.$mp3.'"');
header("Content-Transfer-Encoding: binary");
header("Content-Length: "[email protected]($file));
@readfile($file) OR die("<html>...</html>");
exit;
一切工作在Chrome和Firefox罰款,但在IE 9我有失敗嘗試了許多不同的方式來設置這些標頭後谷歌搜索,但沒有任何幫助。然後我嘗試了一個更小的zip文件,它工作!然後我嘗試了一個更大的zip文件,並再次失敗。這是一些設置在服務器或php.ini什麼的?它爲什麼隻影響IE?
當它在IE失敗,它看起來像它下載..說完成。但該文件是0字節。
感謝您的幫助!
有多大?超過2GB? – 2012-08-16 00:28:34
oh no .. like 80,000 kb – Zac 2012-08-16 01:00:47
IE始終將文件首先下載到其緩存中,然後將其複製到最終目的地。我想知道IE是不是在完成後立即從緩存中刪除文件,因爲它已經過期了。 – cleong 2012-08-16 01:43:41