开发者社区> 问答> 正文

求助,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)

展开
收起
爱吃鱼的程序员 2020-06-14 20:20:35 511 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    系统提示你没写。。。<divclass='ref'>

    引用来自“zhuxinyu”的评论

    系统提示你没写。。。是表单提交的呢,还是Ajax提交的呢?Ajax不支持enctype=”multipart/form-data”的

    问题解决了。

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

    DWZ的前台的form应该写成

    <formmethod="post"action="url"class="pageFormrequired-validate"
    enctype="multipart/form-data"onsubmit="returniframeCallback(this,
    [navTabAjaxDone/dialogAjaxDone]);">



    2020-06-14 20:20:50
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
附件下载测试 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载