php ckeditor上传图片文件名乱码解决方法

yipeiwu_com6年前PHP代码库
打开editor/filemanager/connectors/php目录下commands.php,找到FileUpload函数,在

复制代码 代码如下:

$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;


后添加

复制代码 代码如下:

$sFileName = rand(0,100).".".$sExtension;


此处rand函数可根据需要自行改变重命名规则。
另一种上传图片文件名乱码解决方法为使用iconv函数对文件名进行编码转换,但仍然存在重名问题,所以针对Fckeditor上传图片文件名最好还是重命名

相关文章

paypal即时到账php实现代码

http://paypal.ebay.cn/integrationcenter/list__resource_2.html 中文php开发简介:http://www.paypal-chi...

php实现获取文件mime类型的方法

本文实例讲述了php获取文件mime类型的方法。分享给大家供大家参考。具体如下: 1.使用 mime_content_type 方法 string mime_content_type...

PHP中的strtr函数使用介绍(str_replace)

strtr 有两种形式: string strtr ( string $str , string $from , string $to ) string strtr ( string $...

php数据库备份还原类分享

复制代码 代码如下:<?php/** * 数据库备份还原类 * @author xialeistudio<admin@xialeistudio.net&g...

php 静态变量的初始化

例如: class A { public $f1 = 'xxxx'; static public $f2 = 100; } 如果要将变量赋值为对象,那么只能在构造器中进行初始化,例如:...