I'm trying to reproduce a drag n' drop behavior on Internet Explorer 11 (11.112.17134.0) using the code below:
document.getElementById('file').addEventListener('drop', function (event) {
console.log(event.dataTransfer.files[0].name); // Name of the dropped file
console.log(event.dataTransfer.files.length);
files = event.dataTransfer.files;
document.getElementById('file').
setAttribute('files', event.dataTransfer.files); // Not working
}, false);
The file is being dragged from the local machine's file system. The logs show the correct information and value of the files variable is also correct, but the files attribute from the input comes empty.
It happens only in IE 11, Chrome works fine.
EDIT
Found a solid response. It's not possible to edit the files attribute from input tags.