Skip to main content

tcb storage objects download

Download an object from a Storage bucket to the local machine.

v3.4.0+

PG mode storage commands have been available since @cloudbase/cli@3.4.0.

Usage​

tcb storage objects download <key> [localPath] -b <bucketId> [options]

Parameters​

ParameterRequiredDescriptionDefault
<key>YesObject name—
[localPath]NoLocal path; writes to stdout when omitted; when it points to an existing directory the basename of key is appendedstdout
-b, --bucket <bucketId>YesBucket ID—
-m, --method <method>NoGET / HEADGET
--download <filename>NoTrigger a browser download, equivalent to ?download=<filename>—
--if-none-match <etag>NoIf-None-Match header, authenticated download path only—
--if-modified-since <date>NoIf-Modified-Since header—
--range <range>NoRange header for resumable downloads—
--overwriteNoAllow overwriting an existing local filefalse
--jsonNoReturn metadata only { status, headers }, writes nothing to disk—

When logged in, the command uses the authenticated download path and reaches both private and public buckets; when logged out it falls back to a public download that only reaches public buckets. --method HEAD and --json write no local file.

Examples​

tcb storage objects download test/hello.txt ./hello.txt -b my-bucket
tcb storage objects download test/hello.txt -b my-bucket --range bytes=0-1023
tcb storage objects download test/hello.txt -b my-bucket --json