IPS 中文支持论坛 - IPS Chinese Support Community: [IPB31] IE 下中文附件名乱码修正 - IPS 中文支持论坛 - IPS Chinese Support Community

跳转到内容

第一页
  • 您无法发起一个新主题
  • 您无法回复此主题

[IPB31] IE 下中文附件名乱码修正

#1 已离线   skylook 

  • Advanced Member
  • 点子点子点子点子
  • 用户组: Site Administrator
  • 文章数: 463
  • 注册日期: 2008-01-31

发表于 2010-07-21 16:34:19

修改文件:admin\applications\core\sources\classes\attach\class_attach.php
查找:
header( "Content-Disposition: attachment; filename=\"{$attach['attach_file']}\"" );

修改成:
					//header( "Content-Disposition: attachment; filename=\"{$attach['attach_file']}\"" );
					
					// Fix IE attachment name bug
					// Modified by Skylook -- begin
					// If it is IE browser
					if( (strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0"))  || (strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 7.0")) || (strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 6.0")) )
					{
						header( "Content-Disposition: attachment; filename=\"" . rawurlencode($attach['attach_file']) . "\"" );  
					}
					else
					{
						header( "Content-Disposition: attachment; filename=\"{$attach['attach_file']}\"" );
					}
					// Modified by Skylook -- end

保存即可。

PS:
1、此方法可判断浏览器类型,对于 IE 和 FF 等浏览器均适用;
2、此方法参考:
http://www.ipbchina....96%b9%e6%b3%95/
0

分享主题:


第一页
  • 您无法发起一个新主题
  • 您无法回复此主题