Html – Drag and Drop *FROM* a browser

drag and drophtml

Dragging items into a browser is pretty well documented, and HTML5 makes this easier.

However, I'm wondering if and how it's possible to drag 'n' drop out of a browser.

In this scenario, you'd have a webpage element (eg. an anchor) that the user would click & drag OUT of the browser onto a drop target, and the browser would send the linked object (eg. an href'd file) directly to the drop target instead of starting the usual download.

Does anyone know if this is possible?

Best Answer

The very thing you are trying to do can be found here: https://ryanseddon.com/html5/gmail-dragout/.

This is an explanation for how to drag an anchor tag to the desktop, and the file will be downloaded there. (Or drag the anchor tag onto another application, and the OS will treat it appropriately.)

What I haven't figured out yet, is how to drag-and-drop multiple links (instead of only one at a time) via HTML5, without having to resort to an external resource library like jquery.