最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP中FCK上传图片文件名乱码
时间:2022-06-24 23:39:12 编辑:袖梨 来源:一聚教程网
主要原因是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 )); } |
|
对内容进行转码。
相关文章
- 学信网官方登录入口-个人学历学位认证查询系统 12-20
- 原神AKT资源站网页入口-AKT原神官网链接直达地址 12-20
- CET4准考证成绩防伪验证官方入口-CET4准考证成绩下载快速指南入口 12-20
- yandex网站突然打不开-俄罗斯搜索引擎最新可用入口2025 12-20
- cet4成绩快速查询入口-cet4成绩官方查询入口官网 12-20
- 抖币充值官网入口-抖币充值官网入口1:10 12-20