|  | @ -6,22 +6,22 @@ import org.springframework.context.annotation.Configuration;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | import javax.servlet.MultipartConfigElement;
 |  | import javax.servlet.MultipartConfigElement;
 | 
												
													
														
															|  | import java.io.*;
 |  | import java.io.*;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | /**
 |  | /**
 | 
												
													
														
															|  |  * Created by liub on 2020/9/8.
 |  | 
 | 
												
													
														
															|  | 
 |  |  * Created by liub on 2020/9/11.
 | 
												
													
														
															|  |  */
 |  |  */
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | @Configuration
 |  | @Configuration
 | 
												
													
														
															|  | public class MultipartConfig {
 |  | public class MultipartConfig {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @Bean
 |  |     @Bean
 | 
												
													
														
															|  |     MultipartConfigElement multipartConfigElement() {
 |  |     MultipartConfigElement multipartConfigElement() {
 | 
												
													
														
															|  |         MultipartConfigFactory factory = new MultipartConfigFactory();
 |  |         MultipartConfigFactory factory = new MultipartConfigFactory();
 | 
												
													
														
															|  |         File tmpFile = new File("/data/apps/temp");
 |  | 
 | 
												
													
														
															|  | 
 |  |         String location = "/data/apps/temp2";
 | 
												
													
														
															|  | 
 |  |         File tmpFile = new File(location);
 | 
												
													
														
															|  |         if (!tmpFile.exists()) {
 |  |         if (!tmpFile.exists()) {
 | 
												
													
														
															|  |             tmpFile.mkdirs();
 |  |             tmpFile.mkdirs();
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         factory.setLocation("/data/apps/temp");
 |  | 
 | 
												
													
														
															|  | 
 |  |         factory.setLocation(location);
 | 
												
													
														
															|  |         return factory.createMultipartConfig();
 |  |         return factory.createMultipartConfig();
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | }
 |  | 
 | 
												
													
														
															|  | 
 |  | }
 |