弹簧启动时MultipartFile的最大限制 [英] Max Limit of MultipartFile in spring boot

查看:218
本文介绍了弹簧启动时MultipartFile的最大限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring Boot可以在MultipartFile上传过程中处理最大文件大小。我知道我可以在属性中设置maxFileSize,如 multipart.maxFileSize = 1Mb

Is there a maximum file size that spring boot can handle in a MultipartFile upload process. I know that I can set the maxFileSize in the property like multipart.maxFileSize=1Mb.

因此,我可以允许上传大文件,例如50MB。该应用程序在与spring boot集成的tomcat服务器上运行。我是否还需要配置tomcat服务器。或者文件大小是否无限制?

So, like that can I allow a huge file to upload, like 50MB. The application runs on the tomcat server integrated with spring boot. Do I need to configure the tomcat server also. Or is the file size unlimited?

推荐答案

对于使用Spring Boot 2.0的用户(从M1版本开始),属性名称已更改至:

For those using Spring Boot 2.0 (as of M1 release), the property names have changed to:

spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB

注意前缀是spring.servlet而不是spring.http 。

Note the prefix is "spring.servlet" instead of "spring.http".

这篇关于弹簧启动时MultipartFile的最大限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆