Commit ab7fd7b3 by wangjf

init

parent 908c2d14
package com.reyun.dmp.configuration;
import javax.servlet.MultipartConfigElement;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
/**
* 文件上传配置
*
* @author wangjf
* @date 2018年03月21日15:15:20
*/
public class FileUploadConfiguration {
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
// 设置文件大小限制 ,超出设置页面会抛出异常信息,
// 这样在文件上传的地方就需要进行异常信息的处理了;
factory.setMaxFileSize("256KB"); // KB,MB
/// 设置总上传数据总大小
factory.setMaxRequestSize("512KB");
// Sets the directory location where files will be stored.
// factory.setLocation("路径地址");
return factory.createMultipartConfig();
}
}
package com.reyun.dmp.configuration; import javax.servlet.MultipartConfigElement; import org.springframework.boot.web.servlet.MultipartConfigFactory;import org.springframework.context.annotation.Bean; /** * 文件上传配置 * * @author wangjf * @date 2018年03月21日15:15:20 */public class FileUploadConfiguration { @Bean public MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); // 设置文件大小限制 ,超出设置页面会抛出异常信息, // 这样在文件上传的地方就需要进行异常信息的处理了; factory.setMaxFileSize("256KB"); // KB,MB /// 设置总上传数据总大小 factory.setMaxRequestSize("512KB"); // Sets the directory location where files will be stored. // factory.setLocation("路径地址"); return factory.createMultipartConfig(); } }
\ No newline at end of file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment