亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

PHP IE中下載附件問(wèn)題解決方法

 更新時(shí)間:2014年01月07日 17:48:31   作者:  
在IE中下載附件之前要清空緩存、中文文件名要用urlencode編碼,下面有個(gè)不錯(cuò)的示例,需要的朋友可以參考下
重點(diǎn):

1、在IE中下載附件之前要清空緩存。

2、中文文件名要用urlencode編碼。
復(fù)制代碼 代碼如下:

Header("Pragma: "); //不加的話,IE中會(huì)提示目標(biāo)主機(jī)無(wú)法訪問(wèn)
Header("Cache-Control: "); //不加的話,IE中會(huì)提示目標(biāo)主機(jī)無(wú)法訪問(wèn)
Header("content-type: $type");
Header("accept-ranges: bytes");
Header("Content-Transfer-Encoding:base64");
Header("accept-length: " . filesize($path_c));
Header("content-disposition: attachment; filename=" .urlencode($filename)); //IE中不用urlencode中文名會(huì)出現(xiàn)亂碼
readfile($path_c);
exit;


復(fù)制代碼 代碼如下:

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.urlencode(basename($file) )); //IE中不用urlencode中文名會(huì)出現(xiàn)亂碼
header('Content-Transfer-Encoding: binary'); //二進(jìn)制傳輸
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); //不加的話,IE中會(huì)提示目標(biāo)主機(jī)無(wú)法訪問(wèn)
header('Pragma: public'); //不加的話,IE中會(huì)提示目標(biāo)主機(jī)無(wú)法訪問(wèn)
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;

相關(guān)文章

最新評(píng)論