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

com.sunny.configuration.UploadConfiguration Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
package com.sunny.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * 文件上传配置
 *
 * @author sunny
 * @version 1.0.0
 * @since 2015-08-04
 */
@Configuration
public class UploadConfiguration {

    @Bean(name = "multipartResolver")
    public CommonsMultipartResolver multipartResolver() {
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        resolver.setDefaultEncoding("UTF-8");
        resolver.setMaxUploadSize(1048576);
        resolver.setResolveLazily(false);
        resolver.setMaxInMemorySize(4096);
        return resolver;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy