docman 组件 下载中文名文件时乱码?有高手解决过这个问题吗
我用的是:windows 环境,JOOMLA是1.5.8中文版本.用docman组件上传了中文名的的文件,后台和前台的文件名都显示正常.但是点击下载的时候就出现文件名是乱码了,下载保存在本地的文件名也是乱码.有高手解决过这个问题吗?其他的上传下载组件也有这样的问题,比如com_jdownloads
没有找到相关结果
已邀请:
9 个回复
跑堂小2 - 冇钱;冇房子;冇成就。要吃饭;要住宿;要消费
赞同来自:
如何让 Docman 支持中文文件名
~~~~~~~~~ - 上帝给我的使命,就是证明你们都不是最糟糕的
赞同来自:
不是本人 - no no no!
赞同来自:
{
// Fix [3164]
while (@ob_end_clean())
if( $this-_isLink ){
header( "Location: " . substr( $this-name , 6 ) )
return;
}
$fsize = @filesize($this-path.$this-name)
$mod_date = date('r', filemtime( $this-path.$this-name ) )
$cont_dis = $inline ? 'inline' : 'attachment';
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off')
}
header("Pragma: public")
header("Cache-Control: must-revalidate, post-check=0, pre-check=0")
header("Expires: 0")
header("Content-Transfer-Encoding: binary")
header('Content-Disposition:' . $cont_dis .';'
. ' filename="' . iconv('utf-8','gb2312',$this-name) . '";'
. ' modification-date="' . $mod_date . '";'
. ' size=' . $fsize .';'
) //RFC2183
header("Content-Type: " . $this-mime ) // MIME type
header("Content-Length: " . $fsize)
if( ! ini_get('safe_mode') ) { // set_time_limit doesn't work in safe mode
@set_time_limit(0)
}
// No encoding - we aren't using compression... (RFC1945)
//header("Content-Encoding: none")
//header("Vary: none")
$this-readfile_chunked($this-path.$this-name)
// The caller MUST 'die()'
}
跑堂小2 - 冇钱;冇房子;冇成就。要吃饭;要住宿;要消费
赞同来自:
追梦人 - 梦想每个人都有,但不是每个人都有勇气去坚信,我有
赞同来自:
感谢你找到了解决方案并分享!
~~~~~~~~~ - 上帝给我的使命,就是证明你们都不是最糟糕的
赞同来自:
追梦人 - 梦想每个人都有,但不是每个人都有勇气去坚信,我有
赞同来自:
按照您的这种方法,我测试了一下,上载和下载,在前台和后台看到的文件名都是中文正确的了没有问题。
但是,在服务器上/dmdocuments里的实际文件名却变成乱码了。
另外,我上载了一个文本文件,在文件里写了一些中文字符。
通过前台的"查看"按钮察看,显示的却是乱码,但是现在下来了打开内容却是中文的。
请帮忙救急。谢谢。
刘备曹操 - 古今多少事,都付谈笑中
赞同来自:
孤独者 - 世界属于那些勤于思考的人,更属于那些善于行动的人
赞同来自:
另外,通过前台"查看"按钮查看中文文本文件时,里面的内容也是乱码。