yakovkhalinsky / backblaze-b2

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

Is there a way to use a download url to download without auth headers? #103

Closed GSRdevelopment closed 4 years ago

GSRdevelopment commented 4 years ago

I'm working on a 3D model viewer feature for my app and the client side of the application which is written in Reactjs has a component that renders the .obj model and the only way to successfully load a model is to pass a url paramater which can be either a locally stored file in the computer or a download url (this is how I want to tackle it), the thing is that to download files from backblaze cloud you need to add the authorization headers in order to get the permissions, is there a way to go around this as I need a url that is usable by itself?

odensc commented 4 years ago

You can pass the authorization token from b2_get_download_authorization via the query string. E.g.: https://f345.backblazeb2.com/file/photos/cute/kitten.jpg?Authorization=3_20160803004041_53982a92f631a8c7303e3266_d940c7f5ee17cd1de3758aaacf1024188bc0cd0b_000_20160804004041_0006_dnld

See: https://www.backblaze.com/b2/docs/b2_download_file_by_name.html