问题
I know that it is possible to download a file in Chrome using HTML5 Drag & Drop. It is implemented in Gmail.
Is it possible to download more than one file in one step using Drag & Drop and HTML/JavaScript only?
回答1:
Yes. Chrome has implemented a special protocol for drag and drop out of the browser.
See http://www.html5rocks.com/tutorials/dnd/basics/#toc-desktop-dnd-out
(No other browsers support this that I know of)
回答2:
Try to use:
ev.dataTransfer.items.add(file1);
ev.dataTransfer.items.add(file2);
link: https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/add
来源:https://stackoverflow.com/questions/5860674/multiple-files-download-in-chrome-using-html5-drag-drop