Merge pull request #411 from JCgH4164838Gh792C124B5/WW-5072_fix

Minor change to fix WW-5072

(cherry picked from commit e46e662a7a)
This commit is contained in:
Lukasz Lenart
2020-05-03 12:00:20 +02:00
committed by JCgH4164838Gh792C124B5
parent 0a53999576
commit 6afcbf2861
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>