Minor change to fix WW-5072 (single file upload failure):

- Add action-local method to get upload file size.
- Change file upload validation to use new method.
This commit is contained in:
JCgH4164838Gh792C124B5
2020-05-02 17:47:17 -04:00
parent e32bd7dba9
commit 4786fba0d7
2 changed files with 9 additions and 1 deletions
@@ -84,4 +84,12 @@ public class FileUploadAction extends ActionSupport {
public void setCaption(String caption) {
this.caption = caption;
}
public long getUploadSize() {
if (upload != null) {
return upload.length();
} else {
return 0;
}
}
}
@@ -26,7 +26,7 @@
<validators>
<field name="upload">
<field-validator type="fieldexpression">
<param name="expression"><![CDATA[upload.length() > 0]]></param>
<param name="expression"><![CDATA[getUploadSize() > 0]]></param>
<message>File cannot be empty</message>
</field-validator>
</field>