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

217
Visualizações
onProgress with uploadData() method is giving progress update only once i.e. the final response

I'm using uploadData() method for uploading local file to azure file share.I'm facing issue with onProgress as I'm getting a single progress update i.e. the final update when file finally gets uploaded. Can some guide where I'm going wrong?

await fileClient.uploadData(selectedFile, { rangeSize: 4 * 1024 * 1024, // 4MB range size parallelism: 20, // 20 concurrency onProgress: ev => console.log(ev) });

https://github.com/Azure/azure-sdk-for-js/blob/%40azure/storage-file-share_12.8.0/sdk/storage/storage-file-share/samples/javascript/advanced.js

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Azure Files offers fully managed file shares in the cloud that are accessible via the industry standard Server Message Block (SMB) protocol.

I checked some documents and blogs and found that the method is a parallel uploading method and it just sends a single request to Azure Storage server. So if you want to get onProgress executed many times, I suggest you use the method uploadStream. For more information check this parallel uploading methods.

We can achieve Parallel uploading a Readable stream with ShareFileClient.uploadStream() in Node.js runtime as shown below.

await fileClient.uploadStream(fs.createReadStream(localFilePath), fileSize, 4 * 1024 * 1024, 20, {
abortSignal: AbortController.timeout(30 * 60 * 1000), // Abort uploading with timeout in 30mins
onProgress: (ev) => console.log(ev)
});
console.log("uploadStream success");

Also read this FileUploadStreamOptions interface document for more information.

about 4 years ago · Santiago Trujillo Relatório
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