互联网技术社区|福缘小草|程序员技术博客
🏠首页
  • 开发必备
  • Java
  • Spring Boot
  • MyBatis
  • C#
  • 架构
  • 算法
  • Vue
  • JavaScript
  • HTML
  • MySQL
  • Oracle
  • SQL Server
  • PostgreSQL
  • Redis
  • MongoDB
  • ElasticSearch
  • influxDB
  • ClickHouse
  • Linux
  • Docker
  • K8s
  • 消息队列
  • Shell
  • Git
  • Nginx
  • IDEA
  • Windows
  • 安卓
  • 在线工具
  • 实用技巧
  • 开源项目
  • 好文
  • 资源
  • 网站
  • 导航
💖关于
  • 分类
  • 标签
  • 归档

baohua.yin

不会填坑的程序员不是一个好程序猿!
🏠首页
  • 开发必备
  • Java
  • Spring Boot
  • MyBatis
  • C#
  • 架构
  • 算法
  • Vue
  • JavaScript
  • HTML
  • MySQL
  • Oracle
  • SQL Server
  • PostgreSQL
  • Redis
  • MongoDB
  • ElasticSearch
  • influxDB
  • ClickHouse
  • Linux
  • Docker
  • K8s
  • 消息队列
  • Shell
  • Git
  • Nginx
  • IDEA
  • Windows
  • 安卓
  • 在线工具
  • 实用技巧
  • 开源项目
  • 好文
  • 资源
  • 网站
  • 导航
💖关于
  • 分类
  • 标签
  • 归档
  • The field file exceeds its maximum permitted size
  • SpringBoot集成ip2region2.X
  • Spring Boot
baohua.yin
2023-03-03

The field file exceeds its maximum permitted size

spring boot上传文件报错:The field file exceeds its maximum permitted size of 1048576 bytes

检查配置文件,也配置了maxFileSize。后来查找原因原来是升级了spring boot版本后,配置文件也需要修改,不然识别不了。

Spring Boot1.4版本配置为:

spring.http.multipart.maxFileSize = 50Mb         设置单个文件的大小,

spring.http.multipart.maxRequestSize=500Mb         设置单次请求的文件的总大小
1
2
3

Spring Boot2.0之后的版本配置修改为:

spring.servlet.multipart.max-file-size = 50Mb 

spring.http.multipart.max-request-size=500Mb 
1
2
3

如果是想要不限制文件上传的大小,那么就把两个值都设置为-1就行啦

详情参考Spring Boot官方文档

上次更新: 2023/03/03, 18:36:42
SpringBoot集成ip2region2.X

SpringBoot集成ip2region2.X→

最近更新
01
如何进行科学上网
05-31
02
分享(一个外地女孩,死在了我出租的公寓)
08-18
03
温家宝总理—《我的母亲》
06-13
更多文章>
Copyright © 2019-2025 1024fuli.com | 本站所有资源收集整理于网络,如有侵权请发邮件联系删除。| 粤ICP备18082936号-1 | 由又拍云提供CDN支持
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式