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