ueditor 添加支持文件存储到文件服务器
来源:互联网 发布:javascript入门经典pdf 编辑:程序博客网 时间:2024/06/08 17:36
起因
百度富文本ueditor编辑器默认图片,视频,等文件类型的资源会默认上传到系统的部署目录,但是实际开发过程中,大部分的文件是需要上传到ftp或者文件系统上的。这里提供一个扩展ueditor,使上传的附件上传到文件服务器中。
环境
ueditor.jar版本 为1.4.3.3
解决步骤
1、从官网下载jsp版本和完整源码 。http://ueditor.baidu.com/website/download.html
2、按官方文档将jsp项目导入到eclipse或iead中并正常运行 。
3、复制源码目录中\jsp\src\到iead项目源码中、并把ueditor-xxx.jar依赖去掉。。
4、修改方法
com.baidu.ueditor.ConfigManager.getConfig(int type);
在最加入
conf.put(“externalStoragePath”, this.jsonConfig.optString(“externalStoragePath”));
6、在 com.baidu.ueditor.upload.BinaryUploader类中,添加如下方法取文件存储位置
private static String getPhysicalPath(Map<String, Object> conf, String savePath, String rootPath) { String externalStoragePath = (String) conf.get("externalStoragePath"); String physicalPath; if (externalStoragePath != null && externalStoragePath.trim().length() != 0) { physicalPath = externalStoragePath; } else { physicalPath = rootPath; } physicalPath += savePath; return physicalPath;}
将该类save(HttpServletRequest request,Map
String physicalPath = rootPath + savePath;
改成
String physicalPath = getPhysicalPath(conf, savePath, rootPath);
7、将com.baidu.ueditor.upload.Base64Uploader类按上述修改方式进行同样的修改。
8、在ueditor/jsp/config配置中添加
"externalStoragePath":"/opt/fileService/img/",/*文件服务器路径*/"imageUrlPrefix": "http://xxx.xxx.xxx:8080/xxx/xxx", /* 图片访问路径前缀-要文件服务器的外网地址 */
阅读全文
0 0
- ueditor 添加支持文件存储到文件服务器
- ueditor 添加支持文件存储到文件服务器
- symbian文件服务器:文件存储
- UEditor保存图片时直接通过FTP上传到文件服务器
- post文件到FTP文件服务器
- H2内存数据库 支持存储到文件
- H2内存数据库支持存储到文件
- H2内存数据库 支持存储到文件
- 上传图片文件到Ueditor
- 百度富文本编辑器ueditor上传文件到对象存储BOS中
- 【Maven】添加ueditor到maven本地仓库
- 【Maven】添加ueditor到maven本地仓库
- ueditor 上传文件到ftp java
- 用WebClient将客户端上传文件保存到远端文件服务器
- HttpClient使用详解 (如何上传文件到文件服务器)
- 文件服务器之三:存储
- 文件服务器和流存储
- 百度UEditor添加视频 增加支持“通用代码”功能,支持微信
- Tensorflow White Paper(一)
- Win7(64)+Qt5.5.1+OpenCv3.2+CMake3.5 环境配置过程中遇到的问题及解决方法
- spring mvc 后台向前台传值JSON
- 计算机组成与系统结构学习笔记(1)一 计算机系统概论 [1.1
- Android Http中的Post请求方法
- ueditor 添加支持文件存储到文件服务器
- MT2503 External Buck问题
- type_traits
- oracle 利用url encode decode转换字符编码
- Python-sklearn机器学习的第一个样例(4)
- Zeppelin 初体验
- springMVC : Ambiguous mapping found
- 【集体智慧编程】第三章、发现群组
- 窗口右小角弹出方式(窗口弹出)