I've gone through other similar threads and am not finding my answer, if I missed it, apologies for the duplicate.
I have a simple event handler for file submission with a form. It is as so:
onChange(e) {
let files = e.target.files;
console.log(files);
}
The console log is:
FileList {0: File(692), length: 1}
0: File(692)
lastModified: 1546326376754
lastModifiedDate: Tue Jan 01 2019 00:06:16 GMT-0700 (Mountain Standard Time) {}
name: "userFile.txt"
size: 692
type: "text/plain"
webkitRelativePath: ""
__proto__: File
length: 1
__proto__: FileList
I would like to console.log(files.name)
and get userFile.txt
returned. I am getting undefined
. Very sorry if this has been answered a million times, I've spent a long time searching and trying different dot notations etc. to no avail. Thanks