Struts 1.x file upload when file size > 8MB

情到浓时终转凉″ 提交于 2019-12-12 02:36:49

问题


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

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???

I am using Struts 1.x framework.

Thanks in advance!


回答1:


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

maxPostSize

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).

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

8*1024*1204 =8388608

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

Put the limit in maxPostSize..



来源:https://stackoverflow.com/questions/14767773/struts-1-x-file-upload-when-file-size-8mb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!