What causes
"DOMException: A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs."
at snippet-javascript-console.min.js
?
Minimal, verifiable, complete example to demonstrate the issue
var dropzone = document.querySelector("input[type=file]");
dropzone.ondrop = function(e) {
e.preventDefault();
var item = e.dataTransfer.items[0].webkitGetAsEntry();
var directoryReader = item.createReader();
directoryReader.readEntries(
function(entries) {}
, function(err) {
console.error(err);
}
);
}
<input type="file" webkitdirectory>
To reproduce use Chrome or Chromium browsers and run stacksnippets and drop a directory at <input type="file">
element. The code does not throw an error at either jsfiddle or plnkr.