Garbled file names are generally caused by Chinese characters, because ckeditor uses uft8 encoding. If our page uses gbk or gb2312, garbled characters may occur. The solution is just to rename the uploaded file.
Open commands.php in the editor/filemanager/connectors/php directory, find the FileUpload function, in
The code is as follows
代码如下 |
复制代码 |
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
后添加
$sFileName = rand(0,100).".".$sExtension;
|
|
Copy code
|
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
Add | after
$sFileName = rand(0,100).".".$sExtension;
The rand function here can change the renaming rules as needed.
Another solution to garbled image file names when uploading is to use the iconv function to convert the file name, but there is still a problem of duplicate names, so it is best to rename the image file name uploaded to Fckeditor
http://www.bkjia.com/PHPjc/632759.html
www.bkjia.comhttp: //www.bkjia.com/PHPjc/632759.htmlTechArticleGarbled file names are generally caused by Chinese, because ckeditor uses uft8 encoding. If our page uses gbk or gb2312 may have garbled code problems. The solution is to upload files...