收藏
回答

文件上传无响应

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows 1.06.2303220

微信小程序真机调试,服务端用的SpringBoot框架,然后设置了servlet.multipart.max-file-size=20M,我上传超过20M的图片,微信小程序就没有响应了,服务端会有报错提示,这是为啥?我改成了在Controller接口中判断文件大小20M,微信小程序才有响应

回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    06-03

    你好服务端报错也提供一下看看

    06-03
    有用
    回复 2
    • 颜文君
      颜文君
      06-03
      全局异常信息 ex=Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 20971520 bytes.<br />org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 20971520 bytes.<br /> at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:124)<br /> at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115)<br /> at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:88)<br /> at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:122)<br /> at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1208)<br /> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1042)
      06-03
      回复
    • 颜文君
      颜文君
      06-03
      我用@RestControllerAdvice拦截了全局异常,并且返回了一个响应码,用工具调能返回的,但是不知道为啥微信小程序没有响应
      06-03
      回复
登录 后发表内容