I have spent days wasted getting Spring Boot Upload file to work but, as is always with Spring you have no clue how the magic works and even after years of working with this framework - you have to google tonnes of times to unravel what has gone wrong and solve things like as if you are going thru a maze,it's a maintainability nightmare.
Using Spring Boot 2.2.0.M3 for file uploads what is the difference between the 2 pair's of settings ? Which is right ?
spring.http.multipart.max-file-size=-1
spring.http.multipart.max-request-size=-1
Is the above "http" used with Spring REST controller methods namely like this ... @GetMapping("/files/{filename:.+}") @ResponseBody public ModelAndView yourMethod(.....) Or is this not needed at all and is a complete red-herring and it is the setting below that does all the work for files bigger than the default of 1MB for both REST http or Servlet requests.
spring.servlet.multipart.max-file-size=-1
spring.servlet.multipart.max-request-size=-1
Exception on uploading
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.
Namely ...
@GetMapping("/files/{filename:.+}")
@ResponseBody
Correct ?
– user1561783 May 20 '19 at 17:42