@Bean public CommonsMultipartResolver commonsMultipartResolver() { CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver(); commonsMultipartResolver.setDefaultEncoding("UTF-8"); commonsMultipartResolver.setMaxUploadSize(1024 * 1024 * 256); return commonsMultipartResolver; }
@Bean(name = "multipartResolver") public CommonsMultipartResolver createMultipartResolver() { CommonsMultipartResolver resolver = new CommonsMultipartResolver(); resolver.setDefaultEncoding("utf-8"); resolver.setMaxUploadSize(1024 * 1024); return resolver; }
private MultipartResolver getMultipartResolver() { if (multipartResolver == null) { multipartResolver = new CommonsMultipartResolver(); ((CommonsMultipartResolver) multipartResolver).setDefaultEncoding("UTF-8"); } return multipartResolver; }
@Bean(name = "multipartResolver") public CommonsMultipartResolver createMultipartResolver() { CommonsMultipartResolver resolver = new CommonsMultipartResolver(); resolver.setMaxUploadSizePerFile(2048000); // 2MB resolver.setMaxInMemorySize(2048000); resolver.setDefaultEncoding("utf-8"); return resolver; }
@Bean(name = "multipartResolver") public MultipartResolver getMultipartResolver() { CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); multipartResolver.setMaxUploadSize(10240000); multipartResolver.setDefaultEncoding("UTF-8"); multipartResolver.setMaxInMemorySize(8192); return multipartResolver; }
@Bean(name = "multipartResolver") public CommonsMultipartResolver getResolver() throws IOException { CommonsMultipartResolver resolver = new CommonsMultipartResolver(); // Set the maximum allowed size (in bytes) for each individual file. resolver.setMaxUploadSizePerFile(5242880); // 5MB resolver.setDefaultEncoding("utf-8"); // You may also set other available properties. return resolver; }
@Bean public CommonsMultipartResolver multipartResolver() { CommonsMultipartResolver resolver = new CommonsMultipartResolver(); resolver.setDefaultEncoding("utf-8"); return resolver; }