yakovkhalinsky / backblaze-b2

Node.js Library for the Backblaze B2 Storage Service
MIT License
189 stars 58 forks source link

Byte length not same as content-length #113

Open devksingh4 opened 3 years ago

devksingh4 commented 3 years ago

Hello, When I am downloading arbitrary data stored in B2 bucket, the content-length header has the correct byte length of 208374 but when I call:

Buffer.byteLength(resp.data)

where resp is the await return value from b2.downloadFileById(), I get 378415. Even the backblaze UI shows that the size is 208.4 kB. What is the correct way to decode the data sent from the downloadFileById() method to get the correct-size Buffer or Uint8 array?

zacharytyhacz commented 3 years ago

What is the response's Content-Type ?

devksingh4 commented 3 years ago

What is the response's Content-Type ?

It is application/octet-stream.