Paul,
The one thing I would probably do different is validate the file extension rather than the extension name.
You can then ensure the type of file you want to be uploaded is being uploaded. Is there a particular reason why you want to validate the file name rather than the file extension (type) ?
Best regards,
Brian