Springboot file upload appears the field file exceeds its maximum permitted size of 1048576 bytes. Error, the size of the display file is outside the allowed range. Viewing official documents, the original spring boot project embedded tomcat limits the requested file size, as described in the official Spring boot documentation
65.5 Handling Multipart File uploads
Spring Boot embraces the Servlet 3 Javax.servlet.http.Part API to support uploading files. By default spring Boot configures Spring MVC with a maximum file of 1Mb per file and a maximum of 10Mb of the file data in a s Ingle Request. These values, as well as the location to which intermediate data are stored (e.g., to the/tmp directory) And the threshold past which data is flushed to disk by using the properties exposed in the Multipartproperties class. If you want to specify that files is unlimited, for example, set the Multipart.maxfilesize property to-1.the multipart su Pport is helpful if you want to receive multipart encoded file data as a @RequestParam-annotated parameter of type Multi Partfile in a Spring MVC controller handler method.
The document description indicates that each file is configured to a maximum of 1Mb, and the total number of files per request cannot be greater than 10Mb. To change this default value you need to include two configurations in the configuration file (such as application.properties)
The following two parameters need to be set
Multipart.maxfilesize
Multipart.maxrequestsize
Spring Boot 1.3.x or before
multipart.maxfilesize=100mbmultipart.maxrequestsize=1000mb
Spring Boot 1.4.x or later
spring.http.multipart.maxfilesize=100mbspring.http.multipart.maxrequestsize=1000mb
Spring boot project file upload appears net::err_connection_aborted, file upload failed