I have and I want to get all file names inside this input. I\'ve seen some example, but
you can extend the prototype of File Object (for example File.prototype.toJSON), and you can access the FileList of :
var file = document.getElementById('fileItem').files[0];
For more information check this documentation:
https://developer.mozilla.org/en-US/docs/Web/API/FileList#Using_the_file_list
File.prototype.toJSON = function() {
return {
'lastModified' : this.lastModified,
'lastModifiedDate' : this.lastModifiedDate,
'name' : this.name,
'size' : this.size,
'type' : this.type
};
}
function getFiles() {
var files = document.getElementById('myFiles').files;
document.getElementById('result').innerHTML = 'result
'
+ JSON.stringify(files);
}
Good Luck!