ProgerXP / FileDrop

Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.
filedropjs.org
The Unlicense
264 stars 61 forks source link

IE9 Drag & Drop upload results in Done uploading with 0 bytes #5

Closed listerical85 closed 10 years ago

listerical85 commented 10 years ago

I've been trying your great script for D&D uploading in IE9, however when I try to do so on IE9 the upload seems to trigger the iframeDone event as expected, but states that 0 bytes were received. I've been trying to resolve the issue, and the only thing i could find is that

$_SERVER['HTTP_X_FILE_NAME'] and  file_get_contents("php://input");

come out empty, I thought it was due to my hosting setup, but I'm getting the same result on your site aswell. I hope this is described properly if you need any details don't hesitate to let me know.

ProgerXP commented 10 years ago

Looks serious, I will have to check during the week. Thank you for reporting.

ProgerXP commented 10 years ago

Fixed that. The problem is:

In other words, IE 6-9 will only work with iframe while IE 10+ will work just like every other normal browser (FF/Chrome/Safari).

Please check if this update works on your end and if so I will close the ticket.

listerical85 commented 10 years ago

Thanks for looking into, it so basically there's no way for IE9 to allow Drag&Drop uploads, in anyway possible?

ProgerXP commented 10 years ago

Not as far as I have researched. The problem is that IE 6-9 unlike some other browsers don't fill in the <input type="file"> when a file is dropped there. Therefore it doesn't fire onchange event (but even if it did the input doesn't contain a file anyway). Thus there's no way to even know when a file is dropped, let alone upload it.

Good news is that at least IE 10 has most of FileAPI working and missing readAsBinaryString is easily worked around using readAsArrayBuffer.