sandbox.files.read() to read file contents. Supports text, binary, and streaming modes.
Read as Text
The default format returns file contents as a string:Read as Bytes
For binary files, read as bytes:Stream Large Files
For large files, use streaming to avoid loading everything into memory:Read with User Context
Read files as a specific user:Error Handling
Handle common read errors:Reading Multiple Files
Read multiple files efficiently:Download URL
Get a URL to download files directly:Options Reference
| Option | Type | Description |
|---|---|---|
format | "text" | "bytes" | "stream" | "blob" (JS) | Output format |
user | string | User context for reading |
request_timeout / requestTimeoutMs | number | Operation timeout |