downloadFiles(paths: string[]): Promise<FileDownloadResponse[]>| Name | Type | Description |
|---|---|---|
paths* | string[] | Array of file paths to download |
const results = await sandbox.downloadFiles(["src/index.js", "missing.txt"]);
for (const result of results) {
if (result.content) {
console.log(new TextDecoder().decode(result.content));
} else {
console.error(`Error: ${result.error}`);
}
}Download files from the sandbox.
Each file is read individually, allowing partial success when some files exist and others don't.