微信小程序上传图片报错

发布于 2022-09-12 01:56:09 字数 9165 浏览 12 评论 0

报错
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found↵org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:124)↵org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115)↵org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:88)↵org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:87)↵org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1178)↵org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1012)↵org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)↵org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)↵org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)↵javax.servlet.http.HttpServlet.service(HttpServlet.java:660)↵org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)↵javax.servlet.http.HttpServlet.service(HttpServlet.java:741)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵com.definesys.mpaas.query.filter.MpaasFilter.doFilter(MpaasFilter.java:62)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)↵org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)↵org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵com.hq.book_design_service.config.filter.JwtAuthenticationTokenFilter.doFilterInternal(JwtAuthenticationTokenFilter.java:76)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92)↵org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)↵org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)↵org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)↵org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)↵org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)↵org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)↵org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)↵org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)↵org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)↵org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)↵org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)↵org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)↵org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)↵org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)↵org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)↵org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)↵org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)↵org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)↵org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1598)↵org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)↵java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)↵java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)↵org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)↵java.lang.Thread.run(Thread.java:748)↵Caused by:↵java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found"

已经参考过网上给出的解决办法
1.重启你的项目就可以了(我采用的这种)
2.在application.yml文件中设置multipart location ,并重启项目
但是还是没有解决问题
请问各位大神有什么方法吗

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

郁金香雨 2022-09-19 01:56:09

the request was rejected because no multipart boundary was found。这个提示应该比较明显了。多试试前端上传的contentType类型

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文