Multipart File upload Spring Boot

前端 未结 6 853
栀梦
栀梦 2020-11-29 23:48

Im using Spring Boot and want to use a Controller to receive a multipart file upload. When sending the file I keep getting the error 415 unsupported content type

6条回答
  •  没有蜡笔的小新
    2020-11-30 00:33

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

    put it in class where you are defining beans

提交回复
热议问题