手机
当前位置:查字典教程网 >编程开发 >网页编辑器 >UEditor编辑器自定义上传图片或文件路径的修改方法
UEditor编辑器自定义上传图片或文件路径的修改方法
摘要:使用ueditor编辑器,附件默认在ueditor/php/upload/,我的附件地址是网站根目录下/data/upload/,需要修改u...

使用ueditor编辑器,附件默认在ueditor/php/upload/, 我的附件地址是网站根目录下/data/upload/ ,需要修改ueditor如下:

第一步:打开php/config.php修改图片目录

复制代码 代码如下:

return array(

//图片目录

'imageSavePath' => array (

'../../../../data/upload'

)

);

第二步:图片上传后去掉相对路径php/imageUp.php

复制代码 代码如下:

$info["url"]=str_replace('../../../../', '', $info["url"]);

echo "{'url':'" . $info["url"] . "','title':'" . $title . "','original':'" . $info["originalName"] . "','state':'" . $info["state"] . "'}";

exit;

第三步:打开ueditor.config.js修改图片路径

复制代码 代码如下:

,imagePath:"/"

第四步:如果你想修改图片生成路径或图片名称

修改图片生成路径在php/Uploader.class.php

复制代码 代码如下:

private function getFolder()

{

$pathStr = $this->config[ "savePath" ];

if ( strrchr( $pathStr , "/" ) != "/" ) {

$pathStr .= "/";

}

$pathStr .= date( "Ym/d" );

if ( !file_exists( $pathStr ) ) {

if ( !mkdir( $pathStr , 0777 , true ) ) {

return false;

}

}

return $pathStr;

}

修改文件名,在ueditor.all.min.js中搜索“fileNameFormat”,然后按照官方文档说明修改!

【UEditor编辑器自定义上传图片或文件路径的修改方法】相关文章:

FCKeditor 图片上传进度条不动的解决方法

php下FCKeditor2.6.5网页编辑器的使用方法

FCKEditor 自定义用户目录的修改步骤 (附源码)

通过Fckeditor把图片上传到独立图片服务器的方法

ASP下使用FCKeditor在线编辑器的方法

FCKEditor超级链接默认新窗口打开的修改方法

为ckeditor编辑器加上传图片的功能

FCKeditor 网页在线编辑器的使用方法

ThinkPHP中FCKeditor编辑器的使用方法

XHEditor编辑器使用文档

精品推荐
分类导航