Empty file upload, storeLocation null gives wrong error message.

This commit is contained in:
Greg Huber
2020-09-04 13:23:15 +01:00
parent 7b1c3b0fca
commit 1efcc938cf
@@ -343,6 +343,14 @@ public class FileUploadInterceptor extends AbstractInterceptor {
validation.addFieldError(inputName, errMsg);
}
if (LOG.isWarnEnabled()) {
LOG.warn(errMsg);
}
} else if (file.getContent() == null) {
String errMsg = getTextMessage(action, "struts.messages.error.uploading", new String[]{filename});
if (validation != null) {
validation.addFieldError(inputName, errMsg);
}
if (LOG.isWarnEnabled()) {
LOG.warn(errMsg);
}