I used this:
$(\'input[type=file]\').val()
to get the file name selected, but it returned the full path, as in \"C:\\fakepath\\filename.doc
This alternative seems the most appropriate.
$('input[type="file"]').change(function(e){ var fileName = e.target.files[0].name; alert('The file "' + fileName + '" has been selected.'); });