I am trying to get the filename of the uploaded file into a textbox via jquery. It should be easy enough if there is single file upload button.
But I have file input as an array and beside each file upload button there is a textbox.
I have created a fiddle which will demonstrate more clearly. The problem is I can't get the value/name of the selected file on change function.
$('.imgupload').on('change', function (e) {
var filenames = [].slice.call(e.target.files).map(function (f) {
alert(f.name);
return f.name;
});
$('#filename').val(filenames);
});
JSFiddle -- http://jsfiddle.net/squidraj/Ldcp7hoc/4/