Question:
How do I validate if a user has selected a file to upload before submitting my upload form?
Answer:
Simply check that it’s value contains something. In other words check:
$('#myFileInput').get(0).value //or else in plain vanilla javascript check: document.getElementById('myFileInput').value
Useful to remember.