Posted in: xenforo

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

打开: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
}

Comment (1) on "xenforo的中文附件名在IE环境中下载乱码的解决办法"

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

发表回复

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

Back to Top