Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
Call removeFile in for-loop

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda