에러 메세지
스프링을 통해 파일 업로드를 구현하던중 위와 같은 오류메세지가 발생했다.
"The field imgFile exceeds its maximum permitted size of 1048576 bytes."
업로드 할 수 있는 파일의 최대 용량를 초과하여서 발생한 오류였다.
이 때, 1048576 bytes는 약 1MB로 용량 설정을 하지 않았을 때의 디폴트 값이다.
해결
해결 방법은 spring boot의 파일 용량 설정값을 변경하면 된다.
application.yml
spring:
servlet: #파일 용량 설정
multipart:
max-file-size: 10MB
max-request-size: 10MB
'스프링' 카테고리의 다른 글
@OneToOne 양방향 LazyLoading 실패 (0) | 2023.02.28 |
---|---|
EntityNotFoundException: Unable to find com.aloharoombackend.model.HomeImage with id 1 (0) | 2023.02.28 |
스프링 부트 - 오류 페이지 (0) | 2022.08.20 |
[스프링 MVC 2편] 로그인 처리2 - 필터, 인터셉터 (1) | 2022.07.14 |
[스프링 MVC 2편] 로그인 처리1 - 쿠키, 세션 (2) (0) | 2022.07.14 |