All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zoi7.component.web.config.MultipartConfig Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
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