温红权 5 years ago
parent
commit
77f0ab1d03
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/main/resources/applicationContext-mvc.xml

+ 8 - 0
src/main/resources/applicationContext-mvc.xml

@@ -25,6 +25,14 @@
 	
 	<mvc:resources mapping="/assets/**" location="/assets/" />
 	
+	<bean id="multipartResolver" class="com.youth.controller.fileupload.MultipartListenerResolver">  
+    <!-- 设置上传文件的最大尺寸为100M -->
+    <property name="maxUploadSize" value="1024000"/>
+    <property name="maxInMemorySize" value="4096"/>
+    <property name="defaultEncoding" value="UTF-8"/>
+    <property name="resolveLazily" value="true"/>  
+</bean>
+	
 	<!-- 视图解析器 -->
 	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 		<property name="prefix" value="/WEB-INF/views/"></property>