Skip to main content
edited tags
Link
added 4 characters in body
Source Link
Cerbrus
  • 72.7k
  • 65
  • 370
  • 513

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.

"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.

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.

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.

edited tags
Link
rene
  • 42.3k
  • 55
  • 610
  • 777
Source Link
guest271314
  • 1
  • 1
  • 12
  • 13
Loading