ueditor上传图片报IO错误,怎么破?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ueditor上传图片报IO错误,怎么破?相关的知识,希望对你有一定的参考价值。
ueditor版本1.4.3,java+jsp
在本地测试时,上传没问题,放到服务器上测试,也没有问题
最后部署到购买的空间里面后,上传出现IO错误,有没有大神遇到过这样的问题?
如何破?问题是放到空间里看tomcat的日志里又没有报错信息!怎么追踪错误都不知道
补充一点,本地和服务器都是windows的操作系统,购买的空间貌似是linux的系统,这两种系统的配置有什么差别么?
config.json
/* 上传图片配置项 */
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */
"imageFieldName": "upfile", /* 提交的图片表单名称 */
"imageMaxSize": 2048000, /* 上传大小限制,单位B */
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 1600, /* 图片压缩最长边限制 */
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
"imageUrlPrefix": "http://127.0.0.1:8080", /* 图片访问路径前缀 */
"imagePathFormat": "/upload/image/yyyymmdd/timerand:6", /* 上传保存路径,可以自定义保存路径和文件名格式 */
/* filename 会替换成原文件名,配置这项需要注意中文乱码问题 */
/* rand:6 会替换成随机数,后面的数字是随机数的位数 */
/* time 会替换成时间戳 */
/* yyyy 会替换成四位年份 */
/* yy 会替换成两位年份 */
/* mm 会替换成两位月份 */
/* dd 会替换成两位日期 */
/* hh 会替换成两位小时 */
/* ii 会替换成两位分钟 */
/* ss 会替换成两位秒 */
/* 非法字符 \ : * ? " < > | */
/* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
运行后报错如下:
2014-6-27 14:22:25 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
Throwable occurred: java.lang.NoSuchMethodError: org/apache/commons/io/FileUtils.getTempDirectory()Ljava/io/File;
at com.baidu.ueditor.upload.StorageManager.getTmpFile(StorageManager.java:117)
at com.baidu.ueditor.upload.StorageManager.saveFileByInputStream(StorageManager.java:51)
at com.baidu.ueditor.upload.BinaryUploader.save(BinaryUploader.java:75)
at com.baidu.ueditor.upload.Uploader.doExec(Uploader.java:24)
at com.baidu.ueditor.ActionEnter.invoke(ActionEnter.java:80)
at com.baidu.ueditor.ActionEnter.exec(ActionEnter.java:49)
at org.apache.jsp.core.ueditor.jsp.controller_jsp._jspService(controller_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:173)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:271)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:238)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.isoftstone.fwk.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:735)
你把该引入的包都已经引入了。。 参考技术A 放一个服务器环境探测脚本到你服务器上和你购买的空间里,分别打开看看环境有什么不同之处,可以作为辅助参考排除问题在哪里。很有可能是购买的空间环境某个组件未启用导致。
用FTP软件,修改上传照片后存放的目录权限为777,不行就全部777,最后检查下图片上传限制改为最大值。 参考技术B 调整IIS中最大文件上传,即在webconfig中配置
<httpRuntime maxRequestLength="2097151" />//2个G,自行配置
和
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength ="2147483647" /> //2个G,自行配置
</requestFiltering >
</security>
</system.webServer> 参考技术C 楼主,你这个问题解决了吗?我也遇到了,麻烦告知。 参考技术D 楼主,你这个问题怎么破解的呢?我也刚遇到这个问题,用了两个月没有问题,最近出的这个问题。
ueditor上传图片是提示文件保存出错,怎么解?
在本地测试可以,放在服务器上就出现这样的错误了
你的服务器是linux的吗?可能是目录没有权限的问题追问就是目录权限的问题,
参考技术A 没有配置好追问具体能说一下嘛
追答config.js中上传路径配置
参考技术B 有没有解决?以上是关于ueditor上传图片报IO错误,怎么破?的主要内容,如果未能解决你的问题,请参考以下文章
ueditor1.3.6jsp版在struts2应用中上传图片报"未找到上传文件"解决方案