求助,DWZ的上传问题,怎么老是报错呀!

感觉太煽情 发布于 2014/11/10 14:56
阅读 1K+
收藏 0
DWZ
org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded; charset=UTF-8 at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.(FileUploadBase.java:947) at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115) at com.dxcm.controller.ActivesController.edit(ActivesController.java:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55) at com.dxcm.interceptor.LoginCheckInterceptor.intercept(LoginCheckInterceptor.java:12) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.dxcm.interceptor.CheckTokenInterceptor.intercept(CheckTokenInterceptor.java:11) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.dxcm.interceptor.GlobalInterceptor.intercept(GlobalInterceptor.java:21) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.jfinal.ext.interceptor.SessionInViewInterceptor.intercept(SessionInViewInterceptor.java:44) at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) 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:191) 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:845) 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:619)

以下是问题补充:

@感觉太煽情:我的前台的post提交和enctype="multipart/form-data"都写了。很郁闷呀 (2014/11/10 14:57)
加载中
0
zhuxinyu
zhuxinyu
系统提示你没写。。。
0
感觉太煽情
感觉太煽情

引用来自“zhuxinyu”的评论

系统提示你没写。。。
可是我写了呀,是不是DWZ的不支持呢?
0
battyman
battyman
是表单提交的呢,还是Ajax提交的呢?Ajax不支持enctype=”multipart/form-data”的
0
感觉太煽情
感觉太煽情

问题解决了。

因为 Ajax 不支持enctype="multipart/form-data" 所以用隐藏 iframe 来处理无刷新表单提交.

DWZ的前台的form应该写成

<form method="post" action="url" class="pageForm required-validate"
enctype="multipart/form-data" onsubmit="return iframeCallback(this,
[navTabAjaxDone/dialogAjaxDone]);">



返回顶部
顶部