报错信息
The field file exceeds its maximum permitted size of 1048576 bytes
原因是 SpringBoot内嵌的 tomcat 默认的所有上传的文件大小为 1MB
解决办法
修改配置
yaml
spring:
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
或者
bash
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB
参考 【异常】The field file exceeds its maximum permitted size of 1048576 bytes.