Java Code Examples for org.springframework.boot.web.servlet.MultipartConfigFactory#setMaxRequestSize()

The following examples show how to use org.springframework.boot.web.servlet.MultipartConfigFactory#setMaxRequestSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultipartConfig.java    From springboot-link-admin with Apache License 2.0 7 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
	MultipartConfigFactory factory = new MultipartConfigFactory();
	// 单个文件最大
	factory.setMaxFileSize(DataSize.of(100, DataUnit.MEGABYTES)); // 100MB
	// / 设置总上传数据总大小
	factory.setMaxRequestSize(DataSize.of(100, DataUnit.MEGABYTES));// 100MB
	return factory.createMultipartConfig();
}
 
Example 2
Source File: WebMvcConfigurer.java    From mysiteforme with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    // 设置文件大小限制 ,超出设置页面会抛出异常信息,
    // 这样在文件上传的地方就需要进行异常信息的处理了;
    factory.setMaxFileSize("10MB"); // KB,MB
    /// 设置总上传数据总大小
    factory.setMaxRequestSize("50MB");
    // Sets the directory location where files will be stored.
    // factory.setLocation("路径地址");
    return factory.createMultipartConfig();
}
 
Example 3
Source File: MultipartConfiguration.java    From EasyEE with MIT License 5 votes vote down vote up
@Bean  
public MultipartConfigElement multipartConfigElement() {  
    MultipartConfigFactory factory = new MultipartConfigFactory();  
    long maxFileSize=524288000; //500MB
    long maxRequestSize=524288000; //500MB
    factory.setMaxFileSize(maxFileSize);
    factory.setMaxRequestSize(maxRequestSize);  
    return factory.createMultipartConfig();  
}
 
Example 4
Source File: MultipartConfiguration.java    From EasyEE with MIT License 5 votes vote down vote up
@Bean  
public MultipartConfigElement multipartConfigElement() {  
    MultipartConfigFactory factory = new MultipartConfigFactory();  
    long maxFileSize=524288000; //500MB
    long maxRequestSize=524288000; //500MB
    factory.setMaxFileSize(maxFileSize);
    factory.setMaxRequestSize(maxRequestSize);  
    return factory.createMultipartConfig();  
}
 
Example 5
Source File: Application.java    From java_server with MIT License 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
	MultipartConfigFactory factory = new MultipartConfigFactory();
	// 设置文件大小限制 ,超出设置页面会抛出异常信息,
	// 这样在文件上传的地方就需要进行异常信息的处理了;
	factory.setMaxFileSize("100MB"); // KB,MB
	/// 设置总上传数据总大小
	factory.setMaxRequestSize("100MB");
	// Sets the directory location where files will be stored.
	// factory.setLocation("路径地址");
	return factory.createMultipartConfig();
}
 
Example 6
Source File: Application.java    From SpringbootMybatis with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
	MultipartConfigFactory factory = new MultipartConfigFactory();
	factory.setMaxFileSize("5MB");
	factory.setMaxRequestSize("5MB");
	return factory.createMultipartConfig();
}
 
Example 7
Source File: Application.java    From springBoot-swagger-mybatis-shardbatis with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
	MultipartConfigFactory factory = new MultipartConfigFactory();
	factory.setMaxFileSize("5MB");
	factory.setMaxRequestSize("5MB");
	return factory.createMultipartConfig();
}
 
Example 8
Source File: WebConfig.java    From easyweb with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    // 设置文件大小限制 ,超出设置页面会抛出异常信息,
    // 这样在文件上传的地方就需要进行异常信息的处理了;
    factory.setMaxFileSize("1024KB"); // KB,MB
    /// 设置总上传数据总大小
    factory.setMaxRequestSize("2048KB");
    // Sets the directory location where files will be stored.
    // factory.setLocation("路径地址");
    return factory.createMultipartConfig();
}
 
Example 9
Source File: Application.java    From Resource with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 文件上传配置
 *
 * @return
 */
@Bean
public MultipartConfigElement multipartConfigElement()
{
    MultipartConfigFactory factory = new MultipartConfigFactory();
    //文件最大
    factory.setMaxFileSize("10240KB"); //KB,MB
    /// 设置总上传数据总大小
    factory.setMaxRequestSize("102400KB");
    return factory.createMultipartConfig();
}
 
Example 10
Source File: SystemConfig.java    From redis-manager with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    //文件最大KB,MB
    factory.setMaxFileSize(DataSize.ofBytes(10485760));
    //设置总上传数据总大小
    factory.setMaxRequestSize(DataSize.ofBytes(10485760));
    return factory.createMultipartConfig();
}
 
Example 11
Source File: Config.java    From erp-framework with MIT License 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    //  单个数据大小
    factory.setMaxFileSize("102400KB");
    /// 总上传数据大小
    factory.setMaxRequestSize("512000KB");
    return factory.createMultipartConfig();
}
 
Example 12
Source File: MultipartConfig.java    From FlyCms with MIT License 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement(){
    MultipartConfigFactory factory = new MultipartConfigFactory();
    factory.setMaxFileSize("10MB");
    factory.setMaxRequestSize("10MB");
    return factory.createMultipartConfig();
}
 
Example 13
Source File: WebMvcConfig.java    From mayday with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 文件上传配置
 * 
 * @return
 */
@Bean
public MultipartConfigElement multipartConfigElement() {
	MultipartConfigFactory factory = new MultipartConfigFactory();
	// 单个文件最大 KB,MB
	factory.setMaxFileSize("10240KB");
	/// 设置总上传数据总大小
	factory.setMaxRequestSize("102400KB");
	return factory.createMultipartConfig();
}
 
Example 14
Source File: MultipartConfigurer.java    From mySpringBoot with Apache License 2.0 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement(){
    MultipartConfigFactory factory=new MultipartConfigFactory();
    factory.setMaxFileSize("10MB");
    factory.setMaxRequestSize("10MB");
    return factory.createMultipartConfig();
}
 
Example 15
Source File: FileValidatorConfiguration.java    From cola-cloud with MIT License 5 votes vote down vote up
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    long maxSize = fileUploadProperties.getMaxSize() != null ? fileUploadProperties.getMaxSize() : DEFUALT_MAX_SIZE;
    factory.setMaxFileSize(maxSize);
    factory.setMaxRequestSize(maxSize);
    return factory.createMultipartConfig();
}
 
Example 16
Source File: TbedApplication.java    From Tbed with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * 文件上传配置
 *
 * @return
 */
@Bean
public MultipartConfigElement multipartConfigElement() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    //  单个数据大小
    factory.setMaxFileSize("102400KB"); // KB,MB
    /// 总上传数据大小
    factory.setMaxRequestSize("102400KB");
    //factory.setLocation("/tmp");

    return factory.createMultipartConfig();
}
 
Example 17
Source File: Application.java    From youkefu with Apache License 2.0 5 votes vote down vote up
@Bean   
public MultipartConfigElement multipartConfigElement() {   
        MultipartConfigFactory factory = new MultipartConfigFactory();  
        factory.setMaxFileSize("50MB"); //KB,MB  
        factory.setMaxRequestSize("100MB");   
        return factory.createMultipartConfig();   
}