Validate uploaded filename only if no upload error occured.

Most file upload errors (in particular UPLOAD_ERR_NO_FILE) yield an empty filename. The UploadFile validator does not report the original error in that case, but
FILE_NOT_FOUND instead.

This fix validates the filename only in case of UPLOAD_ERR_OK. Any other error code will be reported correctly.
Merge pull request #6423 from hschletz/UploadErrorCodeShouldPrecedeEmptyFileCheck

Validate uploaded filename only if no upload error occured.
[#6423] No need to nest conditionals
Merge branch 'hotfix/6423'

Close #6423