JVM/Spring

[Web] 파일업로드 시 404 에러 (Current request is not of type )

헹창 2021. 12. 9.
반응형

[Web] 파일업로드 시 404 에러 (Current request is not of type )

 

 

파일업로드 기능 구현 시 발생한 에러

Current request is not of type [org.springframework.web.multipart.MultipartHttpServletRequest]: SecurityContextHolderAwareRequestWrapper

 

url 주소와 post type 등을 모두 확인했음에도 안되는 경우 확인해야하는 부분

 

Spring

 

 

  • context-common.xml
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
	<property name="maxUploadSize" value="100000000" />
	<property name="maxInMemorySize" value="100000000" />
</bean>

 

  • pom.xml
<dependency>
	<groupId>commons-fileupload</groupId>
	<artifactId>commons-fileupload</artifactId>
	<version>1.3.3</version>
</dependency>
<dependency>
	<groupId>commons-io</groupId>
 	<artifactId>commons-io</artifactId>
	<version>2.5</version>
</dependency>

 

 

 

Spring Boot

 

 

  • globals.properties
spring.servlet.multipart.maxFileSize=200MB
spring.servlet.multipart.maxRequestSize=200MB

 

 

 

728x90
반응형

댓글

추천 글