标签:function 文件名 encoding enc nbsp basename 种类 script adf
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); }
标签:function 文件名 encoding enc nbsp basename 种类 script adf
原文地址:http://www.cnblogs.com/lauhp/p/7999686.html