标签:cee spring 文件上传问题 request exce config 类型 ipa red
1. nginx(413 Request Entity Too Large)
首先:【http|server|location】 下设置:client_max_body_size 100m
重启nginx:systemctl restart nginx
2. springboot设置 (报错类型:the request was rejected because its size (226000000) exceeds the configured maximum (104857600))
配置文件添加:
spring:
servlet:
multipart:
max-request-size: 300MB
max-file-size: 300MB
启动类添加:
@Value("${spring.servlet.multipart.max-request-size}")
private String maxFileSize;
@Value("${spring.servlet.multipart.max-file-size}")
private String maxRequestSize;
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
// 单个数据大小
factory.setMaxFileSize(maxFileSize);
// 总上传数据大小
factory.setMaxRequestSize(maxRequestSize);
return factory.createMultipartConfig();
}
标签:cee spring 文件上传问题 request exce config 类型 ipa red
原文地址:https://www.cnblogs.com/changeEveryDay/p/12483806.html