File Input Validation

The following JavaScript code attached to the click event of the Upload button will validate the file type.