Using Jhipster with Spring+Mongo and Gridfs to handle files saved in db. When I'm trying to upload files larger than 1Mb it gives me an 500 error:
java.io.IOException: UT000054: The maximum size 1048576 for an individual file in a multipart request was exceeded
Tried to set this in application-dev.yml without success:
spring:
http:
multipart:
max-file-size: 10MB
max-request-size: 10MB
How could this limit be changed?
Try this,
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
Add this content to WebConfigurer if exist
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("100MB");
factory.setMaxRequestSize("100MB");
return factory.createMultipartConfig();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With