Upload files
Copy a file or a folder into the Computer:- as the local path:
Continue an interrupted upload
If an upload is interrupted, the CLI prints the key that identifies it:Download files
Copy a saved file or folder to this machine, or download every saved file of the Computer into a directory:<computer>@v2:assets. Changes a running Computer has not saved are not
included; add --save-first to cp to save the current files first and
read exactly that version.
Every file is checked against its saved content hash before it takes its
name. Until then, a file waits under a hidden .idyl- name beside its
destination, and a folder’s files wait in .idyl-download at the top of the
directory, which a finished download removes. Permission bits are kept;
ownership and timestamps are not.
To write a saved folder to standard output as a POSIX tar archive, use -:
Continue an interrupted download
A connection lost part way through is picked up where it stopped. If a download is stopped, run the same command again:--output json, the result states what the run read and what it kept:
An Account with a download limit is told when it can continue. Reaching the
limit stops the download with exit code 1, and Ctrl-C stops it with exit code
130. What was fetched is kept either way.
Share a download link
A download link reads one saved file or folder at one version. Anyone who holds the link can read those bytes until it expires, with no other credential, so handle it as a secret. A link never saves the Computer first. In the console, Download hands a link to the browser, whose download manager shows progress and resumes after a break. With the TypeScript SDK:GET and HEAD, and supports a single Range request with
If-Range, so a download manager or a program such as curl -C - can resume
it.
Download from code
The SDKs download with the same checks and resuming as the CLI. TypeScript:DownloadFile writes the file under its name only once every byte is
checked, and a later call with the same destination fetches only what is
missing. DownloadTree downloads a folder in one stream and places each
entry through a TreePlacer you supply, which receives each file once its
bytes are checked. Both return a DownloadResult with the same facts as the
CLI’s JSON result.
Content hashes and entity tags
Every saved file has a content hash, its tag: the SHA-256 of its bytes for a file of up to 4 MiB, and for a larger file the SHA-256 of the SHA-256 hashes of its 4 MiB pieces, in order. A file’s entity tag, as reads and links return it inETag, is the tag and the length together:

