页面使用uploadify 上传控件,使用spring CommonsMultipartipartResolver , 反向代理nginx
- nginx 配置文件
client_max_body_size 10m; 控制上传最大大小为10m, 默认只有1m
2.spring mvc配置
<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="40960"> </property>
</bean>
3.uploadify 配置
$('#appApk').uploadify({
'swf' : 'misc/uploadify.swf',
'uploader' : 'file/upload',
'multi': false,
'fileTypeExts' : '*.apk',
'fileObjName':'file',
'sizeLimit':10240000000, //单位字节
onUploadSuccess : function(file,data,reponse){
}