Spring Boot 2.0.0.M6和文件上传超过10 MB

ale*_*oid 5 spring tomcat spring-boot embedded-tomcat-8 spring-rest

到我的Spring Boot 2.0.0.M6 application.properties我添加了以下几行:

spring.http.multipart.max-file-size=100MB 
spring.http.multipart.max-request-size=100MB
Run Code Online (Sandbox Code Playgroud)

但是当我尝试上传到我的RestController 21MB文件时,它失败并出现以下异常:

Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (21112803) exceeds the configured maximum (10485760)
Run Code Online (Sandbox Code Playgroud)

我在使用Spring Boot打包的Embedded Tomcat上运行我的应用程序.

如何正确配置我的应用程序,以允许文件上传高达100MB?

JB *_*zet 10

文档附录中所示,正确的属性是spring.servlet.multipart.max-file-sizespring.servlet.multipart.max-request-size.