Struts2文件上传最大大小 [英] Struts2 file upload max size

查看:28
本文介绍了Struts2文件上传最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要上传最大 10 MB 的文件.我使用了以下内容.在我的 struts.xml 中,我配置如下.

I need to upload files upto 10 MB.I used the following .In my struts.xml i configured like as follows.

<action name="doUpload" class="com.example.UploadAction">
<interceptor-ref name="fileUpload">
    <param name="maximumSize">20971520</param>
</interceptor-ref>
</action>

我没有配置除此之外的任何其他地方.我收到以下错误.

I did not configured any where other than this.I am getting the following error.

请求被拒绝,因为其大小 (2102840) 超过了配置的最大值 (2097152)

谁能告诉我可能是什么原因.提前谢谢.

Can any one suggest me what might be the reason.Thanks in advance.

推荐答案

把这个放到你的struts.xml文件中

Put this in your struts.xml file

<constant name="struts.multipart.maxSize" value="30000000" />

参见 http://struts.apache.org/2.x/docs/file-upload.html#FileUpload-AdvancedConfiguration.

更新链接 -https://cwiki.apache.org/confluence/display/WW/File+上传

这篇关于Struts2文件上传最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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