Upload files
Read a local file and pass its bytes to files.write:
mjs
import { readFile } from "node:fs/promises";
import { URL } from "node:url";
import { Sandbox } from "@abox-dev/sdk";
const sandbox = await Sandbox.create();
try {
const data = await readFile(new URL("./fixture.txt", import.meta.url));
await sandbox.files.write("/tmp/fixture.txt", data);
console.log("Uploaded fixture.txt");
} finally {
await sandbox.kill();
}File-like objects are streamed by the SDK. For several files, use writeFiles in JavaScript or write_files in Python.