I installed the download of the drag and drop script file in JS (AJAX POST), and I'm having difficulty filtering folders in Safari - version 5.0.3 (6533.19.4).
Whenever I delete several files / folders in the browser, Chrome filters out the folders and Firefox returns 0 for .size , so itβs trivial to protect against these cases. Safari, however, will return a 68-byte file (folder size).
Is there any way to check if this File (item in FileList ) is a folder? Nothing seems to be found in the File / Blob API that checks this condition (it makes no sense to try .type as it returns nothing for unknown files, as well as folders ...)
A bit more info:
Basically what happens is that the AJAX request has an empty body. I load FormData :
var file = ...; // the dropped file var formData = new FormData(); formData.append("file", file); var xhr = new XMLHttpRequest(); ... xhr.send(formData);
html5 safari filter folder drag-and-drop
biasedbit
source share