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

WBOY
Release: 2016-05-17 08:52:53
Original
955 people have browsed it

打开editor/filemanager/connectors/php目录下commands.php,找到FileUpload函数,在

复制代码 代码如下:

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


后添加

复制代码 代码如下:

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


此处rand函数可根据需要自行改变重命名规则。
另一种上传图片文件名乱码解决方法为使用iconv函数对文件名进行编码转换,但仍然存在重名问题,所以针对Fckeditor上传图片文件名最好还是重命名
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!