I have a Rest API build with Spring MVC which has a controller
@RequestMapping(value = "/test", method = RequestMethod.POST)
public void postTest(@RequestBody FileUpload fileUpload) {
System.out.println(fileUpload.getFilename());
System.out.println(fileUpload.getFiletype());
System.out.println(fileUpload.getFilesize());
}
My question is how do I put a size limit on the file being uploaded, so that my server cant be crashed with a upload of 1GB.