I have a list of file object like:
var files = [File, File, File]
I want to convert it to something like:
I have a file field where I want to map my files
as FileList
object.
var uploading_files = {}
files.forEach(function(file, key) {
uploading_files[key] = file
})
var uploader = document.getElementById('uploader')
uploader.files = uploading_files
console.log(uploader.files)
But It does not give me FileList
object ?
How can I create a file list objecdt ?
Thanks in advance..
The FileList object is "read-only" and has no implementation of its constructor.
Visit this page: FileList On MDN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With