关于springboot上传文件报错:The temporary upload location ***is not valid

@Configuration
public class MultipartConfig{
        /**
        *文件临时上传路径
        */
      @Bean
      MultipartConfigElement multipartConfigElement() {
         MultipartConfigFactory factory = new MultipartConfigFactory();
         String location  = System.getProperty("user.dir") +"/data/tmp";
         File tmpFile   =new File (location);
           if(!tmpFile.exists()){
            tmpFile.mkdirs();
             }
         Factory.setLocation(location);
         return factory.createMultipartConfig();
     }    
}

你可能感兴趣的:(关于springboot上传文件报错:The temporary upload location ***is not valid)