返回的文件,我無法下載通過PHP在我的網站上輸出的文件。Firefox 7在升級到Firefox 7後拒絕下載由PHP
一個例子:
比方說,我有聯繫http://example.com/download/1恢復非常正常800KB .ZIP文件,用:
header("Content-Type: application/octet-stream");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Disposition: attachment; filename=" .trim($filename). "");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " .filesize($filePath). ")");
readfile($filePath);
flush();
每一個可能的瀏覽器,甚至是舊版本的Firefox,開始下載文件通常。 Firefox 7引發「損壞的內容錯誤」。
有沒有人注意到類似的行爲?任何可能的解