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

Using e.srcElement.files on IE10 #9

Closed rafaelmaiolla closed 10 years ago

rafaelmaiolla commented 10 years ago

Why you are not using e.srcElement.files on IE to retrieve the files?

In the function self.eventFiles there is the following line:

var list = e.target && e.target.files

Why this is not the following:

var list = e.target && e.target.files || e.srcElement && e.srcElement.files

So you can retrieve the file list on IE too.

ProgerXP commented 10 years ago

I have tested it on IE 8-9 and found no files inside srcElement. Do you see it there when dropping a file? For me it's only available since IE 10 which supports target anyway.

ie9-files

rafaelmaiolla commented 10 years ago

That is only accessible on IE10, where the File API is available.

I was not precise to describe the issue, but e.target is not available on IE10 when you select the file using the "File Explorer" (No drag and drop).

In the current code, if you select a file using the "File explorer", IE10 will fallback to iframe upload because e.target is not available in this case. But you can still access the files using e.srcElement.

ProgerXP commented 10 years ago

For me it's only available since IE 10 which supports target anyway.

By that I meant e.dataTransfer.

But I see your point. Fixed in 39132f1b2a54f52ff9c9e21e7e2e6310fb18a8ac. Thanks for reporting.