> For the complete documentation index, see [llms.txt](https://docs.file0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.file0.dev/sdk/upload.md).

# Upload

```typescript
import fs from "fs";
import { f0 } from "file0";

// Upload a json object
await f0.set("hello.json", JSON.stringify(myBigObject));

// Upload a text file from the file system
await f0.set("logs.txt", fs.readFileSync("./logs.txt"));

// Upload a blob
await f0.set("image.png", new Blob());

// Upload a public file
await f0.set("image.png", myFile, { public: true });

// Upload a file with expiration
await f0.set("image.png", myFile, { ttl: "30d" });
```
