<dependency>
<groupId> commons-fileupload </groupId>
<artifactId> commons-fileupload </artifactId>
<version> 1.3.1 </version>
</dependency>
<dependency>
<groupId> commons-io </groupId>
<artifactId> commons-io </artifactId>
<version> 2.4 </version>
<groupId> commons-fileupload </groupId>
<artifactId> commons-fileupload </artifactId>
<version> 1.3.1 </version>
</dependency>
<dependency>
<groupId> commons-io </groupId>
<artifactId> commons-io </artifactId>
<version> 2.4 </version>
</dependency>
<!-- 文件上传 -->
<bean id="multipartResolver"class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<propertyname="maxUploadSize"value="5242880"/>
</bean>
重点是id 为multipartResolver 要为这个不然spring容器找不到。