Re: [請益] 下載zip 變成 zip.html

看板PHP作者 (127.0.0.1)時間10年前 (2015/05/18 10:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
這段語法我試過 實際上沒什麼問題 你的zip檔裡面是不是放著zip.html safari會自己解壓縮 你要去偏好設定裡面把他關掉 http://i.imgur.com/PIuJSQO.png
把打勾取消掉 ※ 引述《kiey (煉)》之銘言: : 用了下面這段 code 下載後 : 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("Content-Type: application/zip"); : $header="Content-Disposition: attachment; filename=".$zipFileName.";"; : header($header ); : header("Content-Transfer-Encoding: binary"); : header("Content-Length: ".$len); : @readfile($zipFileName); : chrome 正常是 .zip : 可是 safari 卻變成 .zip.html : 不知道各位先進是否有遇到過這問題? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.62.185.25 ※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1431916405.A.396.html
文章代碼(AID): #1LMKzrEM (PHP)
討論串 (同標題文章)
文章代碼(AID): #1LMKzrEM (PHP)