@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();
}
}
网友评论