Java Code Examples for org.springframework.web.multipart.commons.CommonsMultipartResolver#setMaxInMemorySize()

The following examples show how to use org.springframework.web.multipart.commons.CommonsMultipartResolver#setMaxInMemorySize() . 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: WebMvcConfiguration.java    From DouBiNovel with Apache License 2.0 5 votes vote down vote up
@Bean(name = "multipartResolver")
public CommonsMultipartResolver getCommonsMultipartResolver() {
    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
    multipartResolver.setMaxUploadSize(20971520);
    multipartResolver.setMaxInMemorySize(1048576);
    return multipartResolver;
}
 
Example 2
Source File: MultipartResolverConfig.java    From seppb with MIT License 5 votes vote down vote up
@Bean
public CommonsMultipartResolver multipartResolver() {
    CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
    commonsMultipartResolver.setDefaultEncoding(ENCODING);
    commonsMultipartResolver.setMaxUploadSize(MAX_UPLOAD_SIZE);
    commonsMultipartResolver.setMaxInMemorySize(MAX_IN_MEMORY_SIZE);
    return commonsMultipartResolver;
}
 
Example 3
Source File: SpringRootConfig.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
@Bean
public CommonsMultipartResolver multipartResolver() {
    CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
    commonsMultipartResolver.setMaxUploadSize(50 * 1024 * 1024);
    commonsMultipartResolver.setMaxInMemorySize(1024 * 1024);
    return commonsMultipartResolver;
}
 
Example 4
Source File: WebConfig.java    From ssm-demo with MIT License 5 votes vote down vote up
@Bean(name="multipartResolver")
protected CommonsMultipartResolver MultipartResolver() {
	CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
	//multipartResolver.setUploadTempDir(new FileSystemResource("/tmp"));//可以不设置
	multipartResolver.setMaxUploadSize(2097152);//2M
	multipartResolver.setMaxInMemorySize(0);
	multipartResolver.setDefaultEncoding("UTF-8");
	return multipartResolver;
}