To detect if a file was selected, you can find out the length of the file input
$("#bCheck").click(function() { // bCheck is a input type button
var fileName = $("#file1").val();
if(fileName) { // returns true if the string is not empty
alert(fileName + " was selected");
} else { // no file was selected
alert("no file selected");
}
});