function isValidfile(filename)
{

file_value = filename;
var checkfile = file_value.toLowerCase();
if (!checkfile.match(/(\.doc|\.DOC|\.pdf|\.PDF)$/))
{
return false;
}
else
{
return true;
}
}

file type validation in javascript

Leave your comment