yakovkhalinsky/backblaze-b2

onUploadProgress is never called

andrelec1 opened this issue · 1 comments

my code look like :

const uploadPartObj = {
          partNumber: orderedChunks[i + 1].id,
          uploadUrl: tokenInfo.data.uploadUrl,
          uploadAuthToken: tokenInfo.data.authorizationToken,
          data: orderedChunks[i + 1].buffer,
          hash: orderedChunks[i + 1].sha1,
          onUploadProgress: (event) => console.log(event),
        };
await this.#b2.uploadPart(uploadPartObj);

but i never see the console.log, the onUploadProgress is never trigger ...

Hi - onUploadProgress is provided by Axios, which only supports upload progress in browsers. (see axios/axios#1793)

You could make a (less accurate) progress bar by calculating the percentage of parts uploaded. (e.g. numParts / numPartsUploaded)

If you'd like to submit a feature request for this to work in Node, feel free but it's unlikely to be possible without replacing Axios in the library.

Hope this helps.