files.read() returns file content from the sandbox, which local code writes to disk. A second path hands the download to a browser through a pre-signed URL, for clients that hold no API key.
Install the SDK, or the CLI for
ppio commands, and set the PPIO_API_KEY and PPIO_DOMAIN environment variables before running these examples. See Quickstart and Install and authenticate.Download a file
Read the file as bytes, then write those bytes to the local filesystem.Download with a pre-signed URL
Pre-signed download URLs let users download files securely from environments that hold no API key, such as web browsers. Create the sandbox with thesecure: true option, then use the SDK on the trusted backend to generate the download URL.