Failed to bind properties under ‘spring.servlet.multipart.file-size-threshold‘ to
原创
©著作权归作者所有:来自51CTO博客作者潇凝子潇的原创作品,请联系作者获取转载授权,否则将追究法律责任
Description:
Failed to bind properties under 'spring.servlet.multipart.file-size-threshold' to org.springframework.util.unit.DataSize:
Property: spring.servlet.multipart.file-size-threshold
Value: 20M
Origin: class path resource [application.properties]:16:46
Reason: failed to convert java.lang.String to org.springframework.util.unit.DataSize
Action:
Update your application's configuration
Disconnected from the target VM, address: '127.0.0.1:55242', transport: 'socket'
Process finished with exit code 1
Spring Boot 1.3 或之前的版本,配置:
multipart.maxFileSize = 100Mb
multipart.maxRequestSize=150Mb
Spring Boot 1.4 版本后配置更改为:
spring.http.multipart.maxFileSize = 100Mb
spring.http.multipart.maxRequestSize = 150Mb
Spring Boot 2.0 之后的版本配置修改为: 单位Mb改为MB了
spring.servlet.multipart.max-file-size = 100MB
spring.servlet.multipart.max-request-size = 150MB