I wrote a controller as below:
@PostMapping(value="/upload", produces = "application/json")
@ApiOperation("Upload")
@ApiIgnore
public ResponseEntity<ResponseObject> fileUpload(
@RequestParam(value="file") MultipartFile file,
@RequestParam (value="code",required=false, defaultValue="0")String code,
@RequestParam (value="approvaldetails",required=false, defaultValue="0") String approvalDeatils) throws Exception{
return uploadService.uploader(file,code,approvalDeatils);
}
and I configured below at application.porperties:
spring.servlet.multipart.max-file-size=30MB
spring.servlet.multipart.max-request-size=30MB
but I could able to upload file up to ~15MB Editted: Spring boot version: 2.0.1
@M.Mas. 1.I'm using spring boot 2.0.1. 2.Not depends on memory even if I decrease to 8MB, again ~4MB will be acceptable. 3. It is not deployed on the WAR file and I'm debugging. I uploaded a file with 16.8MB and it raised below exception: