Spring boot application. I have a rest endpoint for uploading a multipart file.
Controller.java
@PostMapping(value = "/upload", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
public ResponseEntity uploadFile(
@RequestParam("file") MultipartFile file, @RequestParam("folder") String folder) {
tests.uploadFile(file, folder);
return new ResponseEntity(HttpStatus.OK);
}
Getting the following exception while uploading 5MB file in POSTMAN.
Spring boot version is 2.0.6. I have tried the following methods.
1)spring: tomcat: max-http-form-post-size: 500MB max-swallow-size: 500MB
2)spring: servlet: multipart: max-file-size: 500MB max-request-size: 500MB enabled: true
3)spring: servlet: multipart: max-file-size: -1 max-request-size: -1 enabled: true
Still i am getting this same exception. When i try to upload a small file of size less than 1 mb i am able to process it, but when i try to upload a file of size 5mb or greater i am not able to debug or process it.
Can someone help me on this . Thanks in advance!