yakovkhalinsky/backblaze-b2

Binary file issues - Axios passthrough options not documented

Closed this issue ยท 4 comments

Related to #1

We ran into an issue where binary downloads were not working.
This can be addressed by adding the responseType attribute as an 'arraybuffer'.
There is no documentation on passing through options to the axios library used

e.g. this is the correct way to download binary files.

b2.downloadFileById({
    fileId: fileId,
    responseType: 'arraybuffer'

See a stackoverflow answer related to this issue here:
https://stackoverflow.com/questions/41846669/download-an-image-using-axios-and-convert-it-to-base64

@hubpuller Thank you so much, I was going in circles for about an hour. Also relevant to #15

Yes, we ran in a lot of oval shapes while trying to figure this out! Glad it helped.

#44 from @haywirez has added this to the README, thank you ๐Ÿ‘

Looks like the readme covers this now, so I'll close the issue. ๐Ÿ‘