赞
踩
使用springMVC提供的CommonsMultipartFile类进行读取文件
需要用到上传文件的两个jar包 commons-logging.jar、commons-io-xxx.jar1、在spring配置文件中配置文件上传解析器
- <!-- 文件上传解析器 -->
- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
- <property name="defaultEncoding" value="utf-8"></property>
- <property name="maxUploadSize" value="10485760000"></property><!-- 最大上传文件大小 -->
- <property name="maxInMemorySize" value="10960"></property>
- </bean>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。