💥 Springboot Multipart 파일 업로드 용량 초과 에러

2026. 7. 21. 20:01·Troubleshooting

이 글은 Velog에서 이전한 글입니다. Velog 원문 보기

게시판의 이미지 업로드 기능을 만들던 중 고화질의 이미지를 업로드 하면 오류가 생기는 문제를 발견했다. 이유를 찾아보니 파일 업로드 용량을 따로 설정하지 않아서 발생한 에러였다.

Error: FileSizeLimitExceededException

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

error 로그를 읽어보면 업로드할 수 있는 최대 용량을 넘긴 파일을 업로드 할 때 발생하는 에러다.

default 값이 1048576bytes로 약 1MB이다.

Solution

Spring Boot 2.X

  • application.properties 파일에 아래 코드를 추가한다.
    spring.servlet.multipart.maxFileSize=50MB // 용량
    spring.servlet.multipart.maxRequestSize=50MB // 용량

Spring Boot 1.4.x & 1.5.x

  • application.properties 파일에 아래 코드를 추가한다.
    spring.http.multipart.maxFileSize=50MB
    spring.http.multipart.maxRequestSize=50MB
  • Spring Boot 1.3.x or 그 이전 버전*
  • application.properties 파일에 아래 코드를 추가한다.
    multipart.maxFileSize=50MB
    multipart.maxRequestSize=50MB

'Troubleshooting' 카테고리의 다른 글

[시행착오] AWS 프리티어 비용 과금 이슈, 해결 방법  (0) 2026.07.29
💥 아! Get 요청시에는 Message body를 사용하면 안되는구나!!  (1) 2026.07.29
💥 [Error] JWT Token 인증 문제  (0) 2026.07.28
💥 [Error] Dirty Checking이 안되는 오류  (0) 2026.07.24
💥 Web server failed to start. Port 8080 was already in use  (0) 2026.07.20
'Troubleshooting' 카테고리의 다른 글
  • 💥 아! Get 요청시에는 Message body를 사용하면 안되는구나!!
  • 💥 [Error] JWT Token 인증 문제
  • 💥 [Error] Dirty Checking이 안되는 오류
  • 💥 Web server failed to start. Port 8080 was already in use
pp8817
pp8817
공부한 내용, 개발 관련 지식, 트러블 슈팅 등을 기록합니다. 이전 블로그: https://velog.io/@pp8817/posts
  • pp8817
    끄적이는 개발 log
    pp8817
  • 전체
    오늘
    어제
    • 분류 전체보기 (273)
      • Project (71)
        • 척척학사 (29)
        • Book (23)
        • Saynow (3)
        • YAPP 27기 (4)
        • 나의 작은 프로젝트 (10)
        • Landit (2)
      • Backend (88)
        • Spring (13)
        • Spring MVC (13)
        • Spring Security (4)
        • JPA (26)
        • Database (19)
        • HTTP·Web (13)
        • Architecture (0)
      • Language·CS (59)
        • Java·Kotlin (5)
        • CS Interview (17)
        • Backend Interview (5)
        • Concepts (32)
      • Algorithm (25)
        • Algorithm (24)
        • 소마 알고리즘 스터디 (1)
      • Infra (8)
      • Troubleshooting (11)
      • Retrospective (6)
      • Etc (5)
  • 블로그 메뉴

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

  • 공지사항

  • 인기 글

  • 태그

    CS Interview
    척척학사
    개념 정리!
    트러블슈팅
    Project
    jpa
    java
    나의 작은 프로젝트
    Algorithm
    Book
    http
    interview
    HTTP WEB 기본 지식
    OS
    Spring
    게시판
    Python
    BOJ
    Spring MVC
    object
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
pp8817
💥 Springboot Multipart 파일 업로드 용량 초과 에러
상단으로

티스토리툴바