SpringBoot中上传大文件时-出现报错(the request was rejected because its size exceeds the configured maximum 2031
今天在测试SpringBoot项目时,出现一个报错信息
the request was rejected because its size exceeds the configured maximum 20314588那么为什么会出现这种现象呢?下文笔者将一一道来,如下所示
由于SpringBoot在上传的默认设置中,其值分别为:
multipart.max-file-size大小是1M
max-request-size默认大小是10M
我们只需调整这个最大上传值,即可使后台可接收更大的附件
具体的调整方法,如下所示
在application.yml中添加配置
spring:
servlet:
multipart:
max-file-size: 100MB
max-request-size: 500MB
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。


