Safari xhr drag'n'drop file upload seems to occur twice Safari xhr drag'n'drop file upload seems to occur twice ajax ajax

Safari xhr drag'n'drop file upload seems to occur twice


I would try heavy use of the console to get to the bottom of something like this. Put a console statement at every major piece of code displaying something meaningful each time:

for (var i = 0; i < files.length; i++) {console.log(files[i]+", "+i);    upload(files[i])}; 

and then again inslide your upload().


Could it have something to do with having a variable and a function with the same name (upload)? In Javascript, you can use the name of a function as a reference to it. Try renaming your xhr.upload variable and see if it fixes anything.