Detect folders in Safari with HTML5

JavascriptWeb DevelopmentFront End Scripts

You can try to run the following code to detect folders in Safari −

Array.prototype.forEach.call(e.dataTransfer.files, function (file) {
   var r = new FileReader();
   r.onload = function (event) {
      addFile(file);
   };
   r.onerror = function (event) {
      alert("Uploading folders isn't supported in Safari browser!");
   }
   r.readAsDataURL(file);
});
raja
Published on 06-Apr-2018 17:33:48
Advertisements