Skip to content

chainabit file upload ​

Published (2.2.0) ​

This command is not included in Published (2.2.0). It is available in Development (2.2.0).

Development (2.2.0) ​

Upload a file

Synopsis ​

text
chainabit file upload <path> [options]

Arguments ​

ArgumentDescriptionDefault
<path>Required.—

Options ​

OptionDescriptionDefault
--mime-type <type>File media type—
--yesConfirm this change—

Options shared by every command are described in Global options and shared behavior.

Behavior ​

Uploads a local file to your workspace. Uploading needs consent: in an interactive terminal the command asks you to confirm, and answering no changes nothing. In --json mode or without a terminal you must pass --yes, otherwise the command refuses with exit code 2 before reading the file or sending anything.

The path must be a regular file that is not empty and not larger than the maximum file size the service allows. Folders, wildcards, symbolic links and files with several hard links are refused, and an oversized file is refused before any data is sent. The file keeps its name. --mime-type sets the media type; without it a generic binary type is sent. The command computes the SHA-256 checksum of the file while reading it.

Output ​

The command prints the new file's ID, name, size, SHA-256 checksum and status. With --json, the output contains id, name, sizeBytes, sha256 and status; status is ready once the upload completed. Upload addresses and file contents are never printed.

Authentication and permissions ​

You must be signed in. Uploads count toward the storage of your account.

Examples ​

bash
chainabit file upload ./notes.txt
chainabit file upload ./notes.txt --mime-type text/plain --yes

Built with purpose. chainabit.com