Error:
2020-01-05 10:42:06.524 WARN 17840 --- [io-8080-exec-10] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field editormd-image-file exceeds its maximum permitted size of 1048576 bytes.]
这个意思就是上传的文件超出了其最大允许大小1048576字节
解决方法:
在application.properties中配置如下:
#单个文件最大大小
spring.servlet.multipart.max-file-size=10MB
#所有上传文件最大大小
spring.servlet.multipart.max-request-size=100MB
本文详细解析了SpringBoot应用中文件上传超出大小限制的错误,并提供了具体的解决方案。通过在application.properties中配置spring.servlet.multipart.max-file-size和spring.servlet.multipart.max-request-size参数,可以调整单个文件及总上传文件的最大大小。
1903

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



