In php this is how you would check if a file is selected:
$_FILES[\'item\'][\'size\']>0
what about in JavaScript?
I need to know
So lets say you have some html form and you have a custom file upload input:
And you want to check the filename of the file the user has chosen/selected:
Using jquery
@https://stackoverflow.com/a/5670938/2979938
For those using requireJS:
$("input:file").change(function () {
var fileName = $(this).val();
alert(fileName); //Do with the filename whatever you want
});