I make a file upload system with drag and drop for uploading photo galleries. This is my source code for handling dropdown files. This file works with several files, if I drop them one by one, but when I delete several instances at the same time, this error occurs:
Uncaught InvalidStateError: Failed to execute 'readAsDataURL' on 'FileReader': The object is already busy reading Blobs.
function handleFiles(files) { var reader = new FileReader(); var formdata = new FormData(); $.each(files, function(i, j) { $("td.photos span.status").html("Processing file: "+j.name); formdata.append('file', j); $.ajax({ url: "uploadalbum.php", type: "POST", dataType: "json", data: formdata, processData: false, contentType: false, success: uploadfinished }); reader.onload = handleReaderLoad; reader.readAsDataURL(j); }); }
Any ideas?
javascript jquery html5
umitemree
source share