The field file exceeds its maximum permitted size of 10485760 bytes
时间: 2023-12-17 14:00:31 浏览: 134
php Allowed memory size of 134217728 bytes exhausted
这个错误表示文件的大小超出了允许的范围,具体是10485760字节。这个错误通常发生在SpringBoot项目中的文件上传过程中。默认情况下,SpringBoot内嵌的Tomcat服务器限制了所有上传文件的大小为1MB。如果上传的文件超过了这个限制,就会报错。要解决这个问题,你可以通过更改两个默认设置来增加上传文件的大小限制。首先是`multipart.maxFileSize`,它控制单个文件的最大大小。其次是`multipart.maxRequestSize`,它控制整个请求(包括所有文件)的最大大小。将这两个设置值设置为-1,代表不限制大小。你可以在项目的配置文件(比如application.yml)中添加以下设置来解决这个问题: `spring.servlet.multipart.max-file-size: -1` 和 `spring.servlet.multipart.max-request-size: -1`。这样就可以解除文件大小的限制。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [【异常】The field file exceeds its maximum permitted size of 1048576 bytes.](https://blog.csdn.net/weixin_44299027/article/details/126074192)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [The field file exceeds its maximum permitted size of 1048576 bytes 文件上传大小受到限制,报错!...](https://blog.csdn.net/XikYu/article/details/130528224)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文