sandbox.files to work with files inside a sandbox. Paths refer to the
sandbox’s filesystem, not your computer.
write() creates missing parent directories. It replaces the entire file if that
path already exists.
Upload and download
Usepathlib.Path to read a local file and send its contents to the sandbox:
read() for text and read_bytes() for binary files. Uploads support up to
4 MiB per call. Text reads support approximately 16 MiB, and binary reads support
approximately 12 MiB. Use another transfer method for larger files.
Manage paths
remove():
Transfer larger files
For large inputs, download the file from a URL inside the sandbox when possible. You can also send chunks through a command’s standard input. This example uploads a local file without replacing earlier chunks:cat >> for appending; multiple files.write() calls to the same path would
overwrite each other. Verify the size or checksum after a transfer. For large
outputs, upload from the sandbox to storage you control, then download from there.