<interceptor-ref name="fileUploadStack"> <!-- 大小 --> <param name="fileUpload.maximumSize">10000000</param> <param name="fileUpload.allowedExtensions">.ppt,.pptx,.doc,.docx,.xls,.xlsx</param> <param name="fileUpload.allowedTypes">application/vnd.ms-powerpoint,application/msword,application/excel,application/vnd.ms-excel</param> <param name="fileUpload.useActionMessageBundle">true</param> </interceptor-ref>
以上是单纯的上传大小控制,但是当文件大于系统默认大小时,不会把自定义的国际化错误提示返回到页面。
需要在struts.xml文件内添加
<constant name="struts.multipart.maxSize" value="10000000" />
用来修改系统默认最大上线
时间: 2024-10-31 10:17:55