1

I have done the drag and drop directory upload support. It's working fine in Edge and Firefox browsers. But it's not working in chrome browser, due to not execute the codes which are present inside the readEntries method (see below code snippet).

if (item.isDirectory) {
    var _this = this;
    var directoryReader = item.createReader();
    directoryReader.readEntries(function (entries) {
          entries.forEach(function (entry) {
              _this.traverseFileTree(entry);
          });
          _this.traverseFileTree(true);
          _this.folderFiles = [];
    });
}

Anyone, please guide me why this codes not working in chrome alone and how to run those codes in chrome.?

Mopo
  • 47
  • 3
  • Any errors in the console? – Jeremy Thille Jul 27 '18 at 06:40
  • Also if you used ES6, you wouldn't need that old `var _this = this` hack. Just use the double arrow function to pass the context inside : `.readEntries( entries => entries.forEach( entry => this.traverseFileTree() ) )` – Jeremy Thille Jul 27 '18 at 06:42
  • Hi @JeremyThille: There is no console errors. While running Just skipped those codes. I have used the double arrow function only. Here I have posted the converted javascript codes from typescript. – Mopo Jul 27 '18 at 07:37

0 Answers0