When I add files programmatically to my <input multiple>
element, the length attribute is not modified. If I dig into ti it shows that the files are contained in the input element, but the length stays at zero. I tried manually setting it, but I think the length value is read-only. How can I get the length to update?
//add files to cleared input multiple element
for(i=0; i<newFileListLength; i++){
document.getElementById('documentInput').files[i] = newListOfFiles[i];
}
// change file length value (DOESN'T WORK)
document.getElementById('documentInput').files.length = newFileListLength;