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

Problem when the element dragged is a message from Outlook #39

Open aymenhassine opened 9 years ago

aymenhassine commented 9 years ago

Hello, all is in the title, i try to drag and drop a message directly from Outlook, and drop it into the demo page but it dont seem to work correctly, there is no problem detected but the download dont occur

could you explain to me the reason and if its even possible with such a drag and drop please

best regards

ProgerXP commented 9 years ago

Dragging stuff out of an application is tricky and depends on that application. It uses Windows drag & drop mechanism but it has many flavors. For example, sometimes it would create a temporary file so that drag & drop occurs in two phases: (1) source application saves data to a temporary file on disk, (2) destination application reads that file as if it was dropped directly by the user. If it's this case it usually universally works. However, often direct drag & drop is used so that the source app attempts to transfer the file directly to the destination. This is incompatible in many cases but is more optimal in terms of performance (no need for any temporary files and disk IO).

So to sum up: if you're working with the browser it's best to drop files that are already written to disk. This way it will work 100%. If you're dragging a file that's coming from some other app it might work but also might not (actually, it probably won't work).

andy194 commented 6 years ago

I've been investigating this too. I've found that browsers expect CF_HDROP but Outlook supplies CFSTR_FILECONTENTS & CFSTR_FILEDESCRIPTOR, which browsers don't understand. The drop event is triggered in js code but there's no data that I can find. Lot's of advice on this out there is that the browser needs a custom plugin, but I believe that Microsoft are removing that option from Edge, preferring the Mozilla script mechanism for extensions.

The thing I'm looking into is that the Google search page does receive information from the drop event from Outlook and displays it.