解决方法
现在可以,由于Chrome> = 21。
function traverseFileTree(item,path) { path = path || ""; if (item.isFile) { // Get file item.file(function(file) { console.log("File:",path + file.name); }); } else if (item.isDirectory) { // Get folder contents var dirReader = item.createReader(); dirReader.readEntries(function(entries) { for (var i=0; i<entries.length; i++) { traverseFileTree(entries[i],path + item.name + "/"); } }); } } dropArea.addEventListener("drop",function(event) { event.preventDefault(); var items = event.dataTransfer.items; for (var i=0; i<items.length; i++) { // webkitGetAsEntry is where the magic happens var item = items[i].webkitGetAsEntry(); if (item) { traverseFileTree(item); } } },false);
更多信息:https://protonet.info/blog/html5-experiment-drag-drop-of-folders/