View Source ExBackblaze.Downloads (ex_backblaze v0.1.0)

Authorization is only required to access buckets with a bucketType of "allPrivate"

The auth token must have the readFiles capability. This is required if the bucket containing the file is not public. It is optional for buckets that are public. Alternatively, a download authorization token obtained from b2_get_download_authorization can be used to access files whose names begin with the filename prefix that was used to generate the download authorization token.

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

Endpoints:

  • b2_download_file_by_id
  • b2_download_file_by_name

Link to this section Summary

Link to this section Functions

Link to this function

download_file_by_id(token, file, headers \\ [], opts \\ [])

View Source
@spec download_file_by_id(
  ExBackblaze.Tokens.Token.t(),
  ExBackblaze.Files.File.t(),
  any(),
  any()
) ::
  {:ok, ExBackblaze.Files.File.t()}

GET /b2_download_file_by_id

required-params

Required Params

Required Params are interpolated into the request url

  • %File{fileId: file_id}
  • %Token{downloadUrl: download_url}

see-docs

See docs:

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

options

Options

opts are encoded as URL query params

examples

Examples

iex> ExBackblaze.Downloads.download_file_by_id(token, file, [Authorization: "3_2016080_d943_dnld"])
{:ok, ExBackblaze.Files.File{}}
Link to this function

download_file_by_name(token, bucket, file, headers \\ [], opts \\ [])

View Source

GET /b2_download_file_by_name

required-params

Required Params

  • %Token{downloadUrl: download_url}
  • %File{fileId: file_id}

see-docs

See docs:

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

options

Options

opts are encoded as URL query params

examples

Examples

iex> ExBackblaze.Downloads.download_file_by_name(token, bucket, file, [Authorization: "3_2016080_d943_dnld"])
{:ok, ExBackblaze.Files.File{}}