I have a list of file objects, for example:
var files = [File, File, File]
I want to convert it to something like:
I have a file field in which I want to display the object filesas FileList.
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 an object FileList? How to create a list of objecdt files? Thanks in advance.
source
share