主要原因是fck中的编(utf-8)码和本地的编码(gbk)环紧不一致导致的,修改如下5个文件可以解决
更改FileUpLoad函数 ckeditor/" target="_blank">fckeditoreditorfilemanagerconnectorsphpcommands.php
在文件中找到以下代码:
| 代码如下 | 复制代码 |
|
// Get the extension. |
|
在其后加上一句:
| 代码如下 | 复制代码 |
|
$sFileName = strtotime('now').'.'.$sExtension; |
|
这样文件名就是 当前时间戳+后缀名了。既解决了中文乱码,也解决了文件重名
另一种解决办法,保留中文名
文件4:fckeditoreditorfilemanagerconnectorsphpcommands.php
找到
| 代码如下 | 复制代码 |
|
function FileUpload( $resourceType, $currentFolder, $sCommand ){ 。。。 找到 //move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ; move_uploaded_file( $oFile['tmp_name'], iconv("utf-8","gbk",$sFilePath)); } |
|
对文件名$sFilePath转码。
文件5:fckeditoreditorfilemanagerconnectorsphputil.php
找到
| 代码如下 | 复制代码 |
|
function ConvertToXmlAttribute( $value ){ 。。。 找到 //return ( utf8_encode( htmlspecialchars( $value ) ) ) ; return iconv("GBK", "UTF-8", htmlspecialchars( $value )); } |
|
对内容进行转码。