Hi,
If you want the validate file type using the file upload control means like the wheather it is .doc or .xls or etc., using Javascript
fuUserList -- File upload control
var fuData = document.getElementById('<%=fuUserList.ClientID%>');
var fileUploadPath = fuData.value;
var extension = fileUploadPath.substring(fileUploadPath.lastIndexOf('.')
+ 1).toLowerCase();
if (extension == "xls" || extension == "xlsx")
{
return true; // Valid file type
}
else
{
document.getElementById('<%=divExcelError.ClientID%>').style.display = "block";
return false; // Not valid file type
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment