0

I am working on a file upload component.

Step 1. Browser uploads a file to my own backend service

Step 2. Backend service will then upload this file to a cloud storage service.

And I want to track the uploading progress.

superagent
.post('/api/upload')
.send(formData)
.on('progress', function(e) {
  console.log(e.percent)
})
.end(function(err, res) {
  console.log('done')
})

I tried to use the code above, but e.percent would reach 100 when Step 1 was done

What I want to e.percent will reach 100 when both steps are done.

Thanks.

Littlee
  • 3,791
  • 6
  • 29
  • 61

0 Answers0