当文件大小>时,Struts 1.x文件上传. 8MB [英] Struts 1.x file upload when file size > 8MB

查看:137
本文介绍了当文件大小>时,Struts 1.x文件上传. 8MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中上传一个文件(已压缩的excel).文件大小将近8MB.因此会产生尺寸错误.

I want to upload a file(zipped excel) in my application. The file size is almost 8MB. So it gives size error.

我尝试上传一个小文件,效果很好.但是对于大于1 MB的大小,则不起作用.

I have tried to upload a small file, it works fine. But for size> 1 MB, it does not work.

是否可以解决上传大(压缩)文件的问题?

Is there any work around for uploading big (zipped) files???

我正在使用Struts 1.x框架.

I am using Struts 1.x framework.

提前谢谢!

推荐答案

来自 http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

maxPostSize

maxPostSize

容器FORM URL参数解析将处理的POST的最大大小(以字节为单位).可以通过将此属性设置为小于或等于0的值来禁用该限制.如果未指定,则将该属性设置为2097152(2兆字节).

The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

在{Tomcat安装文件夹} \ conf \

Locate server.xml in {Tomcat installation folder}\ conf \

8 * 1024 * 1204 = 8388608

8*1024*1204 =8388608

<Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"         
redirectPort="8443" maxPostSize="8388608" />

将限制放入maxPostSize..

Put the limit in maxPostSize..

这篇关于当文件大小&gt;时,Struts 1.x文件上传. 8MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆