PHP下载zip文件
$filename = $navi_html_static_path . '/' . $zip_name . '.zip'; header("Cache-Control: public"); header("Content-Description: File Transfer"); header('Content-disposition: attachment; filename='.basename($filename)); //⽂件名 header("Content-Type: application/zip"); //zip格式的 header("Content-Transfer-Encoding: binary"); //告诉浏览器,这是⼆进制⽂件 header('Content-Length: '. filesize($filename)); //告诉浏览器,⽂件⼤⼩ @readfile($filename);
0 条评论
登陆后才能评论哦~