Is it possible to cache DirectoryEntry once it is selected by the user so that even after refresh the contents of that directory can be accessed. The point is to eliminate dropping the directory each time the web app is opened.
Directory is accessed this way
var dropzone = document.getElementById('dropzone');
dropzone.ondrop = function(e) {
var length = e.dataTransfer.items.length;
for (var i = 0; i < length; i++) {
var entry = e.dataTransfer.items[i].webkitGetAsEntry();
if (entry.isFile) {
... // do whatever you want
} else if (entry.isDirectory) {
... // do whatever you want
}
}
};
<div id=”dropzone”></div>
Is there a way to pre-select directory and ask the permission only?