How To Get Names Of All Files In The Input That Has The Multiple Attribute?
I have a input with the multiple attribute on my page: If the user selects, let's say, 3 files
Solution 1:
Try this,
var inp = document.getElementById('input-file-video');
for (var i = 0; i < inp.files.length; ++i) {
var name = inp.files.item(i).name;
alert("file name: " + name);
}
In jQuery, $('#input-file-video').get(0).files;
will return the list of files that are uploaded. So you can loop through and get the files names.
Post a Comment for "How To Get Names Of All Files In The Input That Has The Multiple Attribute?"