Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!