解決辦法
注入對(duì)象
@Bean
MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setLocation("E://tomcat_file/temp");
return factory.createMultipartConfig();
}
或者在配置文件中添加:
spring.http.multipart.location=E://tomcat_file/temp