从JoomlaCode上看到有人提供上传中文文件名变乱码的解决方法,但是我没试成功,请教
从JoomlaCode上看到有人提供上传中文文件名变乱码的解决方法,但是我没试成功,请教
方法:
Here is the solution:
/*
Open joomla\libraries\joomla\filesystem\file.php at line 496
Insert file-path encode conversion
DEFAULT_ENCODE defined for 'UTF-8', SYSTEM_ENCODE defined for 'GBK'
*/
$dest = iconv(DEFAULT_ENCODE, SYSTEM_ENCODE, $dest);
if (is_writeable($baseDir) && move_uploaded_file($src, $dest))
After modifying, try again. You can find that everything is ok. Wait, an other problem still exists. When I try to delete
the uplo
方法:
Here is the solution:
/*
Open joomla\libraries\joomla\filesystem\file.php at line 496
Insert file-path encode conversion
DEFAULT_ENCODE defined for 'UTF-8', SYSTEM_ENCODE defined for 'GBK'
*/
$dest = iconv(DEFAULT_ENCODE, SYSTEM_ENCODE, $dest);
if (is_writeable($baseDir) && move_uploaded_file($src, $dest))
After modifying, try again. You can find that everything is ok. Wait, an other problem still exists. When I try to delete
the uplo
没有找到相关结果
已邀请:
2 个回复
跑堂小2 - 冇钱;冇房子;冇成就。要吃饭;要住宿;要消费
赞同来自:
如果要移植这样的代码,我建议向 Kunena 学习。因为 Kunena 论坛组件早就实现这个功能了,无论你上传什么样字符的文件名,如果含有 UTF-8 字符,Kunena 都会自动改名。
刘备曹操 - 古今多少事,都付谈笑中
赞同来自: