国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP IE中下載附件問題解決方法

2024-05-04 23:20:20
字體:
來源:轉載
供稿:網友
重點:

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

2、中文文件名要用urlencode編碼。

復制代碼 代碼如下:


Header("Pragma: "); //不加的話,IE中會提示目標主機無法訪問
Header("Cache-Control: "); //不加的話,IE中會提示目標主機無法訪問
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中文名會出現亂碼
readfile($path_c);
exit;



復制代碼 代碼如下:


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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 甘谷县| 友谊县| 郧西县| 公主岭市| 南平市| 天峨县| 宁夏| 海原县| 元阳县| 英德市| 土默特左旗| 泰顺县| 乐业县| 惠水县| 德化县| 任丘市| 洪雅县| 惠水县| 娄烦县| 专栏| 舒城县| 普宁市| 遵化市| 信丰县| 泸州市| 高邮市| 蒲江县| 定远县| 航空| 宜宾县| 新安县| 自治县| 西青区| 皋兰县| 芜湖县| 大邑县| 旬阳县| 旅游| 崇信县| 涞源县| 旬阳县|