![JAR search and dependency download from the Maven repository](/logo.png)
com.zoi7.component.web.config.MultipartConfig Maven / Gradle / Ivy
package com.zoi7.component.web.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
/**
* 配置tomcat上传限制
*
* @author yjy
* 2018-04-24 14:38
*/
@Configuration
public class MultipartConfig {
/**
* 配置tomcat上传限制
* @return 配置
*/
@Bean
public MultipartConfigElement multipartConfigElement(){
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("50MB");
factory.setMaxRequestSize("10MB");
return factory.createMultipartConfig();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy