Once you try to upload a file with size more than 10 MB. You will face the following error.
The solution I Applied is is as follows.
[org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; 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.]
The solution I Applied is is as follows.
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("124MB");
factory.setMaxRequestSize("124MB");
return factory.createMultipartConfig();
}
Ref: https://www.experts-exchange.com/questions/28990849/How-to-increase-Spring-boot-Tomcat-max-file-upload-size.html
No comments:
Post a Comment