header("Pragma: public");header("Cache-control: max-age=".$expire);//header('Cache-Control: no-store, no-cache, must-revalidate');header("Expires: " . gmdate("D, d M Y H:i:s",time()+$expire) . "GMT");header("Last-Modified: " . gmdate("D, d M Y H:i:s",time()) . "GMT");header("Content-Disposition: attachment; filename=".$showname);header("Content-Length: ".$length);header("Content-type: ".$type);header('Content-Encoding: none');header("Content-Transfer-Encoding: binary" );if($content == '' ) {readfile($filename);}else {echo($content);}exit();這是http里面的一段代碼,可是我用它只能讀出到瀏覽器中。
1 回答

絕地無雙
TA貢獻1946條經驗 獲得超4個贊
header("Content-type: application/octet-stream;");
或者修改 httpd 的 mime.types 里面對應的文件類型為 application/octet-stream
- 1 回答
- 0 關注
- 171 瀏覽
添加回答
舉報
0/150
提交
取消