How can I validate if the user has selected a file to upload?
Edit: bumped
Check it's value property:
value
In jQuery (since your tag mentions it):
$('#fileInput').val()
Or in vanilla JavaScript:
document.getElementById('myFileInput').value