美文网首页
关于springboot上传文件报错:The temporary

关于springboot上传文件报错:The temporary

作者: 路过的人儿 | 来源:发表于2019-08-09 12:04 被阅读0次
@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

      本文链接:https://www.haomeiwen.com/subject/dswcjctx.html