I have a filelist as show here. I would like to add another file to that list.
I've tried this but it doesn't add the file:
var newFileOnList = //...
// fileInput is an HTML input element: <input type="file" id="myfileinput" multiple>
var fileInput = document.getElementById("myfileinput");
var files = fileInput.files;
files.push(newFileOnList);
Edit:
I could even replace the list too, but this doesn't work either:
var newFileList = //...
// fileInput is an HTML input element: <input type="file" id="myfileinput" multiple>
var fileInput = document.getElementById("myfileinput");
fileInput.files = newFileList;