Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6974959
  • 博文数量: 701
  • 博客积分: 10821
  • 博客等级: 上将
  • 技术积分: 12021
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-02 10:41
个人简介

中科院架构师,专注企业数字化各个方面,MES/ERP/CRM/OA、物联网、传感器、大数据、ML、AI、云计算openstack、Linux、SpringCloud。

文章分类

全部博文(701)

分类:

2006-02-21 13:57:16

使用UTF-8的VBB3论坛在下载中文附件时,在IE下会出现,而在Firefox下正常,经过摸索,终于发现了解决方法,与诸君分享:

  打开attachment.php文件,查找:

header('-control: -age=31536000');
header('Expires: ' . gmdate("D, d M Y H:i:s", TIMENOW + 31536000) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $attachmentinfo['dateline']) . ' GMT');

在其后添加:

if (!isset($isIE))
    {
        static
$isIE;
        
$isIE = iif(is_('ie'), true, false);
    }
    
if (
$isIE)
    {
        
$attachmentinfo[filename] = iconv("UTF-8","GBK",$attachmentinfo[filename]);    
    }

若没有iconv库,但是Linux主机,可以将后半部分替换为:

if ($isIE)
    {
        
$cmd = "echo '$attachmentinfo[filename]' | iconv -f UTF-8 -t GBK";
        
$attachmentinfo[filename] = shell_exec($cmd);        
    }
阅读(2178) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~