header 頭各種類型文件下載


function down_file($url,$type='application/zip'){     header("Cache-Control: public");      header("Content-Description: File Transfer");      header('Content-disposition: attachment; filename='.basename($url)); //文件名        header("Content-Type: ".$type); //zip格式的        header("Content-Transfer-Encoding: binary"); //告訴瀏覽器,這是二進制文件         header('Content-Length: '. filesize($url)); //告訴瀏覽器,文件大小        @readfile($url); }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM