Description:The below javascript funtion checks the browsing file. For example, If the uploading file should accept only excel and word documents like that, then in that scenario, we can use this function.<script type="text/javascript"> function CheckFileExtension() { var ctrlUpload = document.getElementById('< %=FileUpload.ClientID% >'); //Does the user browse or select a file or not if (ctrlUpload.value =='' ) { alert("Select a file to upload!"); ctrlUpload.focus(); return false; } //Extension List for validation. Add your required extension here with comma separator var extensionList = new Array(".xls", ".doc"); //Get Selected file extension var extension = ctrlUpload.value.slice(ctrlUpload.value.indexOf(".")).toLowerCase(); //Check file extension with your required extension list. for (var i = 0; i < extensionList.length; i++) { if (extensionList[i] == extension) return true; } alert("You can only upload below File Type:\n\n"+extensionList.join("\n")); ctrlUpload.focus(); return false; } </script>