반응형
FileUploadBase$SizeLimitExceededException
Spring Boot 에서 파일 업로드를 하다가 오류가 나서 콘솔을 보니 용량 제한이 있었다.
프로필에서 maxFileSize를 설정해주면 되는데,
주의할 점은 maxRequestSize도 설정이 필요하다.
Spring Boot 1.3.x and earlier
multipart.maxFileSizemultipart.maxRequestSize
Spring Boot 1.4.x and 1.5.x
spring.http.multipart.maxFileSizespring.http.multipart.maxRequestSize
Spring Boot 2.x
spring.servlet.multipart.maxFileSizespring.servlet.multipart.maxRequestSize
내 경우는 application.yml로 설정하게 되어 있으므로 다음 설정을 추가하였다.
spring:
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
막 바이트 계산 안하고 그냥 MB로 적어주면 되니 편하다.
반응형
'프로그래밍 > Java' 카테고리의 다른 글
| List<?>를 사이즈별 List<List<?>> 로 나누기 (Lists.partition) (0) | 2020.05.11 |
|---|---|
| Java try-with-resources (0) | 2019.08.21 |
| Tomcat + MySQL에서 [java.sql.SQLException: Already closed.] 발생 (0) | 2017.09.19 |
| 일반 뷰 Controller를 ajax로 데이터만 받아서 쓰기 (Interceptor 사용) (0) | 2017.08.18 |
| EL/JSTL, Javascript 함께 사용할 때 따옴표(") 홑따옴표(') 처리 (0) | 2017.07.28 |