在application中添加限制 :

在springBoot  1.x 版本下使用

spring.http.multipart.max-file-size =100M

spring.http.multipart.max-request-size =100M

在springBoot  2.x 版本下使用:

spring.servlet.multipart.max-file-size =100M

spring.servlet.multipart.max-request-size =100M

 

在yml下配置:

在 springboot 1.X 版本下
spring:
http:
multipart:
enabled: true
max-file-size: 50MB
max-request-size: 50MB


在 springboot 2.X 版本下
spring:
servlet:
multipart:
enabled: true
max-file-size: 50MB
max-request-size: 50MB

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2021-11-14
  • 2021-09-19
  • 2021-08-10
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-11-12
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案