Files & screenshots
Transfer documents and save browser outputs.
| Output | How to save it |
|---|---|
| Website upload | Upload through the file API, then use its remote browser path |
| Website download | List ready downloads and stream the selected file |
| Screenshot or PDF | Save bytes returned by Playwright or Puppeteer |
| Extracted data | Validate and save in your application |
Session files
With an initialized client and a ready session:
const uploaded = await client.sessions.files.upload(session.id, {
filename: "input.csv",
contentType: "text/csv",
file: new TextEncoder().encode("name,value\nexample,1\n"),
});
console.log(uploaded.browserPath);| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | bytes, Blob, or stream | Yes | — | Content to upload |
filename | string | Yes | — | Plain filename |
contentType | string | No | Binary content | MIME type |
sizeBytes | number | No | Inferred when possible | Declared length |
Python accepts bytes, pathlib.Path, or a binary file. Your application owns any file object it opened.
| Limit | Value |
|---|---|
| Single file | 64 MiB |
| All session files | 256 MiB; incomplete uploads reserve space |
| Availability | Ready, unexpired session only |
| List page | 1–100 items; follow nextCursor |
Retrieve files before closing. browserPath is remote, not a path on your application's machine.
See file transfer, screenshots, and the complete file workflow.
Session files are temporary. Save long-term outputs in your application.