Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: The field pimage exceeds its maximum permitted size of 1048576 bytes 오류가 발생하였을때의 해결 방법

2021. 12. 20. 18:28·Spring Framework Error

 

Maximum upload size exceeded; 
nested exception is java.lang.IllegalStateException:
org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException: 
The field pimage exceeds its maximum permitted size of 1048576 bytes

 

위 오류는 클라이언트 측에서 넘어온 파일을 저장 할려고 할때 저장할 수 있는 파일의 최대용량을 설정해주지 않아 default값( 1048576 bytes)으로 설정이 돼서 저장할려고 하는 이미지 파일의 용량이 1048576 bytes를 넘어 발생하는 오류입니다. 해결방법은 아래와 같이 application.properties 파일에 용량 설정을 추가하여줍니다.

 

 

#application.properties

1
2
3
spring.servlet.multipart.maxFileSize=5MB
spring.servlet.multipart.maxRequestSize=5MB
 
Colored by Color Scripter
cs

 

 

 

저작자표시 (새창열림)

'Spring Framework Error' 카테고리의 다른 글

Spring Boot CORS 해결하는 법(ngrok CORS도 해결)  (0) 2022.01.21
JSP 파일 생성 후 첫 시작 <%@ 부분에 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 란 오류가 발생하였을 때  (0) 2021.12.24
Oracle DB 연결 과정중 The Network Adapter could not establish the connection 오류가 발생하였을때.  (0) 2021.12.12
Starting Tomcat v9.0 Server at localhost' has encountered a problem 또는 Web server failed to start. Port 8080 was already in use 같은 톰캣 서버 충돌 오류 발생 시  (0) 2021.12.11
Tomcat 서버는 작동하는데 Spring Boot가 실행이 안되어서 HTTP 상태 404 - 찾을수 없음 에러가 발생하였을때  (0) 2021.12.10
'Spring Framework Error' 카테고리의 다른 글
  • Spring Boot CORS 해결하는 법(ngrok CORS도 해결)
  • JSP 파일 생성 후 첫 시작 <%@ 부분에 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 란 오류가 발생하였을 때
  • Oracle DB 연결 과정중 The Network Adapter could not establish the connection 오류가 발생하였을때.
  • Starting Tomcat v9.0 Server at localhost' has encountered a problem 또는 Web server failed to start. Port 8080 was already in use 같은 톰캣 서버 충돌 오류 발생 시
「김동윤」
「김동윤」
개발을 하면서 기록하고 공유하는 공간입니다
  • 「김동윤」
    평범한 개발 블로그
    「김동윤」
  • 전체
    오늘
    어제
    • 분류 전체보기 (21)
      • DB (3)
      • Git (1)
      • Spring Framework (6)
      • Spring Framework Error (9)
      • JS (2)
        • node.js (1)
        • react (1)
      • 머신 러닝 (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 개인 github
  • 공지사항

  • 인기 글

  • 태그

  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
「김동윤」
Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: The field pimage exceeds its maximum permitted size of 1048576 bytes 오류가 발생하였을때의 해결 방법
상단으로

티스토리툴바