文件下載工作 - 除了大文件下載 - 大文件下載過快,打開時損壞 - 我得到錯誤信息(for壓縮文件):無法打開文件:它看起來不是有效的壓縮文件。該文件是高清上傳OK並且該文件夾php頭文件下載 - 無法打開文件:它似乎不是一個有效的檔案
在這是PHP代碼我使用強制頭下載
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));
ob_clean();
flush();
readfile($file);
exit;
您是否收到錯誤消息?例如。 abuot最大文件大小或時間? – PeeHaa 2012-07-25 09:30:34
no - 不能看到任何錯誤 – Jeff 2012-07-25 09:33:39
您是否啓用了錯誤報告? – PeeHaa 2012-07-25 09:34:14