<interceptor-ref name= "FileUpload" >
<param name= "Allowedtypes" >image/bmp,image/png,image/gif,image/jpeg,image/pjpeg</param>
<!--picture cannot be greater than 5M
<param name= "MaximumSize" >5242880</param>
</interceptor-ref>
Problem:
Set the picture can not be greater than 5M, but upload more than 2M image directly error jump input;
Workaround:
<!--the largest size of files uploaded throughout the project
<constant name= "struts.multipart.maxSize" value= "9000000"/>;
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 inside will have the following hints:
The request was rejected because its size (16272982) exceeds the configured maximum (9000000)
The MaximumSize property of the 2.fileUpload 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 files between Struts.multipart.maxSize and MaximumSize, the system prompts the upload to be successful!
Struts file upload blocker maximumsize setting file size does not work