Drag and Drop Try Assigning a File to Input Type

I have code that works in chrome but does not work on ie11 and firefox ... when I research on the Internet due to a security problem, I cannot go through. Is there any other way I can do

 var dt = e.dataTransfer || (e.originalEvent && e.originalEvent.dataTransfer);
    var files = dt.files;
    if (files) {
        // UploadFile(files[0]);
       // $('#file').val(files);
       $("#FileUploadForm input#file")[0].files = files;
        document.getElementById("filename").innerText = files[0].name;
    }
+4
source share

All Articles