It depends on the type of validation you are using. I think there is a fileExtension validation type and you can just use the server file name to validate. The server variable should be coming from the file upload binding not the form directly. Also make sure you move the file upload code above the validation. It will be below by default and will need to be moved above to validate file size.