I have a PUT request method in the controller where I upload zip file and the method takes it as inputstream and processes the stream. It works well with file sizes of Kb. Now I uploaded a zip file of 10Mb size, and it works fine the first time. The second time, it doesn't upload and I get the BAD request error. When I restart the service, it works fine for the first time and the second time I receive the same BAD Request 400 error. Pease advise
@RequestMapping(path = “/upload/{fileName}”, method = PUT,
consumes = "multipart/form-data", produces = "application/json; charset=UTF-8")
public void upload(@PathVariable(“fileName”) String fileName,
@RequestBody MultipartFile[] multipartFile) throws IOException{
//inputstream is processed here
}