/** * Create a new {@link MultipartConfigElement} using the properties. * @return a new {@link MultipartConfigElement} configured using there properties */ public MultipartConfigElement createMultipartConfig() { MultipartConfigFactory factory = new MultipartConfigFactory(); if (StringUtils.hasText(this.fileSizeThreshold)) { factory.setFileSizeThreshold(this.fileSizeThreshold); } if (StringUtils.hasText(this.location)) { factory.setLocation(this.location); } if (StringUtils.hasText(this.maxRequestSize)) { factory.setMaxRequestSize(this.maxRequestSize); } if (StringUtils.hasText(this.maxFileSize)) { factory.setMaxFileSize(this.maxFileSize); } return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement(){ MultipartConfigFactory factory=new MultipartConfigFactory(); factory.setMaxFileSize("1MB"); factory.setMaxRequestSize("2MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("128MB"); factory.setMaxRequestSize("500MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("10MB"); factory.setMaxRequestSize("10MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("5MB"); factory.setMaxRequestSize("5MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement(){ MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("256MB"); factory.setMaxRequestSize("256MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfigElement(){ MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("10MB"); factory.setMaxRequestSize("10MB"); return factory.createMultipartConfig(); }
@Bean public MultipartConfigElement multipartConfig() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setMaxFileSize("128KB"); factory.setMaxRequestSize("128KB"); return factory.createMultipartConfig(); }
@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(); }
@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(); }
@Bean MultipartConfigElement multipartConfigElement() { return new MultipartConfigFactory().createMultipartConfig(); }