作者localhost (127.0.0.1)
看板PHP
标题Re: [请益] 下载zip 变成 zip.html
时间Mon May 18 10:33:22 2015
这段语法我试过 实际上没什麽问题
你的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://webptt.com/cn.aspx?n=bbs/PHP/M.1431916405.A.396.html