ckeditor和ckfinder结合使用时问题的解决办法
来源:互联网 发布:200万网络摄像机一夜 编辑:程序博客网 时间:2024/06/05 03:43
ckeditor是很流行的的文本编辑器,ckfinder是它的补充,为ckeditor提供图片、flash上传功能,在使用它们的过程中,遇到一些问题,记录下来。
1、当上传图片名称是中文时,上传失败。解决办法:在tomcat的配置文件server.xml中,在Connector组件处,加上 URIEncoding="utf-8"。
2、重复上传同一文件,报错,解决办法,修改FileUploadCommand.java类,在execute方法开始出加上errorCode=0;如下所示:
@Overridepublic void execute(final OutputStream out) throws ConnectorException {if (configuration.isDebugMode() && this.exception != null) {throw new ConnectorException(this.errorCode, this.exception);}try {errorCode=0;String errorMsg = (this.errorCode == 0) ? "" : ErrorUtils.getInstance().getErrorMsgByLangAndCode(this.langCode,this.errorCode, this.configuration);errorMsg = errorMsg.replaceAll("%1", Matcher.quoteReplacement(this.newFileName));String path = "";if (!uploaded) {this.newFileName = "";this.currentFolder = "";} else {path = configuration.getTypes().get(type).getUrl()+ this.currentFolder;}if (this.responseType != null && this.responseType.equals("txt")) {out.write((this.newFileName + "|" + errorMsg).getBytes("UTF-8"));} else {out.write("<script type=\"text/javascript\">".getBytes("UTF-8"));if (checkFuncNum()) {handleOnUploadCompleteCallFuncResponse(out, errorMsg, path);} else {handleOnUploadCompleteResponse(out, errorMsg);}out.write("</script>".getBytes("UTF-8"));}} catch (IOException e) {throw new ConnectorException(Constants.Errors.CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED, e);}}
阅读源代码可以发现,当文件存在时,系统会给这个赋值201,导致出错。
0 0
- ckeditor和ckfinder结合使用时问题的解决办法
- ckEditor 和 ckFinder 的使用
- ckeditor和ckfinder的使用
- CKEditor结合CKfinder的学习
- ASP ckeditor和ckfinder的使用
- Ckeditor和ckfinder完美结合,配置使用说明
- CKfinder和CKeditor使用笔记
- CKEditor和CKFinder的使用说明
- CKEditor和CKFinder的使用说明
- CKEditor使用js结合CKFinder实现上传,解决项目路径问题
- play framework 之 整合 ckeditor 和 ckfinder 时注意的一些问题
- ckeditor和ckfinder结合,使不同用户上传文件到自己的文件夹
- PHP中CKEditor和CKFinder使用心得
- asp.net下使用CKEditor和CKFinder
- 在JSP里使用CKEditor和CKFinder
- 在JSP里使用CKEditor和CKFinder
- 在JSP里使用CKEditor和CKFinder
- 在JSP里使用CKEditor和CKFinder
- iOS周刊 第三期
- Tomcat部署web项目
- RNote__Reshape2
- GridView实现超链接列和图片列,跳转页面并传递参数
- ios周刊 第四期
- ckeditor和ckfinder结合使用时问题的解决办法
- 仿微信主界面导航栏图标字体颜色的变化
- 欢迎使用CSDN-markdown编辑器
- Elastic Search使用
- C++运算符重载代码分析
- Java Socket应用(三)——java中URL的应用
- pixhawk学习笔记---创建新的应用程序
- 最大流 ISAP
- dubbox+oceanus