weixiyen / jquery-filedrop

jQuery plugin - drag and drop desktop files and POST to a URL to handle files.
958 stars 285 forks source link

File upload in ie10 #117

Closed wallymathieu closed 11 years ago

wallymathieu commented 11 years ago

A bit of a hack, but looks like it's working.

jbroadway commented 11 years ago

I also had to move the xhr.withCredentials line to just after the xhr.open call to fix an InvalidStateError message, but otherwise this seems to work well.

wallymathieu commented 11 years ago

How do you reproduce the InvalidStateError message?

jbroadway commented 11 years ago

Hmm, I'm not sure. It just kept coming up whenever I tried dropping a file, so I googled around and it seemed others found that waiting to set xhr.withCredentials til after the xhr.open was called fixed it. I tried that and it worked. I'm using IE10 through VMWare Fusion from the modern.IE downloads.

wallymathieu commented 11 years ago

Updated the feature detection based on above.

eternicode commented 11 years ago

Turns out the FileReader.readAsBinaryString method isn't even really in the spec. Strange that MDN doesn't mention this at all, but it somewhat explains why IE10 doesn't support it.

I've added a patch to this series to clean things up a bit and move all browsers to using the standard FileReader.readAsDataURL and atob function, and it now seems to work in FF, Chrome, IE10, and Opera (not Safari at the moment).