Commit 276af4fb by chenweisong

更新

parent 69685d9a
...@@ -5,9 +5,8 @@ import org.springframework.context.annotation.Bean; ...@@ -5,9 +5,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement; import javax.servlet.MultipartConfigElement;
import java.io.File;
//@Configuration @Configuration
public class AppConfig { public class AppConfig {
...@@ -17,12 +16,7 @@ public class AppConfig { ...@@ -17,12 +16,7 @@ public class AppConfig {
@Bean @Bean
MultipartConfigElement multipartConfigElement() { MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory(); MultipartConfigFactory factory = new MultipartConfigFactory();
String location = System.getProperty("user.dir") + "/data/tmp"; factory.setLocation("./temp");
File tmpFile = new File(location);
if (!tmpFile.exists()) {
tmpFile.mkdirs();
}
factory.setLocation(location);
return factory.createMultipartConfig(); return factory.createMultipartConfig();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment