Spring Boot: ClassNotFoundException when configuring maxUploadSize of CommonMultipartResolver

后端 未结 4 1967
庸人自扰
庸人自扰 2020-12-13 11:12

I\'m using Spring Boot for my web application and I\'m trying to configure the maxUploadSize of Spring\'s CommonMultipartResolver. Currently, it seems to be limited by a Spr

4条回答
  •  隐瞒了意图╮
    2020-12-13 11:48

    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize("5120MB");
        factory.setMaxRequestSize("5120MB");
        return factory.createMultipartConfig();
    }
    

    Try adding this in the class where you are defining beans.

提交回复
热议问题