In a dropzone.js, I have a script to create multiple folders, and this works with 2 actions, after a button (so autoprocessqueue is false).
The first action is to create the right database-entry, and create the folder. This returns an object with the Foldername, and the UUID from the database.
If this fails, the Foldername gets the value false instead of the UUID.
Then I process my dropzone.getQueuedFiles to remove files where the folder has not been created.
However in this for-loop not every file is deleted, but only some of it.
document.getElementById('CreateBundelButton').addEventListener("click", function(e) {
axios.post(uploadConfig.multibundelUploadUrl + collectie.uuid + '/', { collectie : collectie , isBundelCreateAndCheck : true , folders : BundelFolders })
.then( response => {
console.log("Received UUIDs")
for(let fList = 0 ; fList < dropzone.getQueuedFiles().length ; fList++) {
let rootFolder = (dropzone.getQueuedFiles()[fList].fullPath).split('/')[0]
if(response.data.uuidList[rootFolder] !== false) {
//set folder-view as created
} else {
dropzone.removeFile(dropzone.getQueuedFiles()[fList])
}
}
//setAutoProcessDropzone(true)
//dropzone.processQueue()
}
}
So when I click the button, not every file from the folder where response.data.uuidList[rootFolder] = false get removed.
Update: everytime only half of the files are removed from the queue. So a folder with 100 files, 50 are removed, a folder with 10, 5 are removed.