解除spring-boot上傳圖片大小的限制
阿新 • • 發佈:2019-01-09
- 由spring官方文件可知,spring-boot在
MultipartProperties
配置檔案中對最大上傳大小做了限制需要在啟動時增加一個配置類 在啟動類裡增加以下類即可解決問題
/** * 解除上傳檔案的限制 */ @Configuration @ConditionalOnClass({Servlet.class, StandardServletMultipartResolver.class, MultipartConfigElement.class}) @ConditionalOnProperty(prefix = "spring.http.multipart"