tractorbeam blobs
Upload the files Blob fields reference.
tractorbeam blobs <subcommand> [flags]
Shared flags
Every subcommand takes these flags.
| Flag | Description |
|---|---|
--config <string> |
The Project’s tractorbeam.config.ts. Defaults to the one in the current directory or its nearest ancestor. |
--workspace <string> |
Workspace name. Environment variable: TRACTORBEAM_WORKSPACE. |
--origin <string> |
The Tractorbeam origin to call instead of the default, such as a proxy’s. Environment variable: TRACTORBEAM_ORIGIN. |
--token <string> |
Access token. Defaults to the saved interactive session. Environment variable: TRACTORBEAM_TOKEN. |
blobs upload
Upload a file as a Blob of the Workspace and print the reference a Blob field holds.
tractorbeam blobs upload [flags] <file>
| Argument | Description |
|---|---|
<file> |
The file to upload. |
| Flag | Description |
|---|---|
--media-type <string> |
The file’s media type. Defaults to one its extension names. |
--table <string> |
A Table whose Blob field --field checks the file before it uploads. |
--field <string> |
The Blob field of --table the file is for. |
Examples:
# Upload logo.png and print its reference
tractorbeam blobs upload logo.png
# Check the file against the contracts Table's document field, then upload it
tractorbeam blobs upload contract.pdf --table contracts --field document
blobs create-url
Reads one field of one document in a Table, or of one Object of an Object type, as the caller can read it at the Branch’s HEAD and returns a URL to the Blob the field references. The URL is valid for a few minutes. The bytes come straight from the Workspace’s object storage. With download, the URL’s response includes a Content-Disposition: attachment header naming the file for the field. A browser then saves the file.
tractorbeam blobs create-url [flags]
| Flag | Description |
|---|---|
--download <true|false> |
|
--branch <string> |
Branch name. Defaults to the Branch you last switched to, or main. Environment variable: TRACTORBEAM_BRANCH. |
--json <json> |
The request’s body as JSON. |