springboot 2.x 上传文件-Maximum upload size exceeded; nested exception is java.lang.IllegalStateException

2022年9月19日 605点热度 0人点赞 0条评论

1 异常信息

{
    "timestamp": 1658334124992,
    "status": 500,
    "error": "Internal Server Error",
    "message": "Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceeds its maximum permitted size of 1048576 bytes.",
    "path": "xxx"
}

Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: 
org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: 
the request was rejected because its size (5019) exceeds the configured maximum (1024)

 

解决办法

spring:
    servlet:
        multipart:
            max-file-size: 50MB 
            max-request-size: 50MB

 

管理员

这个人很懒,什么都没留下

文章评论