How to set the max size of upload file

前端 未结 16 668
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 12:13

I\'m developing application based on Spring Boot and AngularJS using JHipster. My question is how to set max size of uploading files?

If I\'m trying

16条回答
  •  北海茫月
    2020-12-04 12:25

    I found the the solution at Expert Exchange, which worked fine for me.

    @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

提交回复
热议问题