Multiple files download in Chrome using HTML5 Drag & Drop [closed]

左心房为你撑大大i 提交于 2019-12-21 12:23:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!