xenforo的中文附件名在IE环境中下载乱码的解决办法

Posted by

打开:xenforo\library\XenForo\ViewPublic\Attachment\view.php
更改如下:
if (in_array($extension, array_keys($imageTypes)))
{
$this->_response->setHeader('Content-type', $imageTypes[$extension], true);
//chinese file name encoder
//$this->setDownloadFileName($attachment['filename'], true);
$this->setDownloadFileName( (@iconv("UTF-8", $charsett, $attachment['filename'])), true);
//chinese file name encoder end
}
else
{
$this->_response->setHeader('Content-type', 'unknown/unknown', true);
//chinese file name encoder
//$this->setDownloadFileName($attachment['filename']);
$this->setDownloadFileName(@iconv("UTF-8", $charsett, $attachment['filename']));
//chinese file name encoder end
}

One comment

  1. 使用此方法,服务器必须要开始iconv函数

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注