Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Byte length not same as content-length #113

Open
devksingh4 opened this issue Jun 19, 2021 · 2 comments
Open

Byte length not same as content-length #113

devksingh4 opened this issue Jun 19, 2021 · 2 comments

Comments

@devksingh4
Copy link

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
Copy link

What is the response's Content-Type ?

@devksingh4
Copy link
Author

What is the response's Content-Type ?

It is application/octet-stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants