Struts2 file Upload Size limit issue

Source: Internet
Author: User

Problem: Upload large file error ... FIX: Modify the parameters in the Struts.xml file as follows
<constant name= "struts.multipart.maxSize" value= "55000000"/>

<action name= "UploadFile" class= "Com.buptisc.srpms.action.UploadFileAction" >
<result name= "Uploadfileresult" >/pages/ShowOtherFiles.jsp</result>
<result name= "Jgbsuccess" >/pages/JGBdetail.jsp</result>
<interceptor-ref name= "FileUpload" >
<param name= "Savepath" >/data</param>

</interceptor-ref>
<interceptor-ref name= "Defaultstack" ></interceptor-ref>
</action>

The size of the Struts.xml file is related to the actual file size: 1048576 (Bytes) = 1024*1024 = 1M actual file size.

Struts.multipart.maxSize controls the maximum size of files uploaded throughout the project
The MaximumSize attribute division of the Struts.multipart.maxSize and FileUpload interceptors is different and is summarized as follows: 1.struts.multipart.maxsize controls the maximum size of files uploaded throughout the project. More than this size, background error, the program can not handle such a large file. Fielderror will have the following hint: The request was rejected because its size (16272982) exceeds the configured maximum (9000000) 2.FILEUPL The MaximumSize property of the Oad interceptor must be less than the value of struts.multipart.maxSize. Struts.multipart.maxSize default 2M, when MaximumSize is greater than 2M, you must set the value of struts.multipart.maxSize greater than maximumsize. 3. When the uploaded file is larger than Struts.multipart.maxSize, the system error when uploading the file between Struts.multipart.maxSize and MaximumSize, the system prompts: file too Large:file " The MSF concept. ppt "Upload__5133e516_129ce85285f__7ffa_00000005.tmp" 6007104 when the uploaded file is less than MaximumSize, the upload succeeds.

Struts2 file Upload Size limit issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.