보라코딩
스프링 파일 업로드 본문
pom.xml
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
servlet-context.xml
<beans:bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<beans:property name="defaultEncoding" value="UTF-8"/>
<beans:property name="maxUploadSize" value="104857560"/> <!-- 50MB 필수x -->
<beans:property name="maxUploadSizePerFile" value="2097152"/> <!-- 50MB 필수x -->
<beans:property name="uploadTempDir" value="file:/C:/upload/tmp"/> <!-- 1MB 필수x-->
<beans:property name="maxInMemorySize" value="1048576"/> <!-- 1MB 필수x-->
</beans:bean>
'코딩 > Spring' 카테고리의 다른 글
STS와 GitHub 연동 (0) | 2023.05.10 |
---|---|
스프링 예외 처리 (0) | 2023.05.10 |
코드로 배우는 스프링 웹 프로젝트 (pom.xml, root-context.xml) (1) | 2023.05.10 |
스프링 참고자료 (개념) (0) | 2023.05.08 |
Thymeleaf 문법정리 (0) | 2023.05.08 |