I have got an input file upload , need to check which file is uploaded / if no file is selected by the client using jquery.
See the sample I have created:
http://jsfiddle.net/G7xke/
check
And JavaScript:
$("#check").click(function(){ var fileName = $("#file1").val(); if(fileName.lastIndexOf("png")===fileName.length-3) alert("OK"); else alert("Not PNG"); })