file url

Display download URL for a file

Prints an URL that can be used to download the given file, if it is public.

If it is private, you can use –with-auth to include an authorization token in the URL that allows downloads from the given bucket for files whose names start with the given file name.

The URL will work for the given file, but is not specific to that file. Files with longer names that start with the give file name can also be downloaded with the same auth token.

The token is valid for the duration specified, which defaults to 86400 seconds (one day).

Requires capability:

  • shareFiles (if using –with-auth)

b2 file url [-h] [--with-auth] [--duration DURATION] B2_URI

Positional Arguments


B2 URI pointing to a file, e.g. b2://yourBucket/file.txt or b2id://fileId

Named Arguments


Default: False


Default: 86400