I want elements of a webpage dragged&dropped out of the browser window contain arbitrary file objects, which can be dropped to e.g. a file browser.
event.dataTransfer.files contain text and being able to drop it in a text editor works for me by adding the text via
e.dataTransfer.setData("text/plain", "hello world);
However adding files doesn't work this way. I can call
e.dataTransfer.items.add() with an file object without errors but with no effect in the external window neither.
e.dataTransfer.items.add() (as the documentation suggests) also doesn't work for the text, so I guess, I'm missing something.
What's the equivalent to
dataTransfer.setData("text/plain", "hello world); for files then?