org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceeded the limit for maxPostSize set on the associated connector
这是由于请求数据超过默认限制20MB,导致抛出异常。只需再配置文件中加入:
server:
tomcat:
max-http-form-post-size: 100MB
即可解决。
本文介绍了解决Spring框架中因请求数据超过默认限制(20MB)而引发的MultipartException异常的方法。通过调整Tomcat配置,将max-http-form-post-size参数设置为100MB,可以有效避免此问题。
8335

被折叠的 条评论
为什么被折叠?



