1. 程式人生 > >Spring Boot 批量上傳: The field files exceeds its maximum permitted size of 1048576 bytes.

Spring Boot 批量上傳: The field files exceeds its maximum permitted size of 1048576 bytes.

Spring Boot 批量上傳異常: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field files exceeds its maximum permitted size of 1048576 bytes.

Spring Boot以Servlet 3 javax.servlet.http.Part API支援上傳檔案,對上傳檔案大小作了限制,可檢視官方文件,如


解決方法,配置property引數,如

# Single file max size
multipart.maxFileSize: 100Mb
# All files max size
multipart.maxRequestSize: 1000Mb