Browse/Cloudflare/R2: Upload Object
R2: Upload Object
Cloudflare
$19 · Pro
Upload a file to Cloudflare R2 storage (S3-compatible API).
r2-upload-object.ts
await r2Client.send(new PutObjectCommand({ Bucket: bucketName, Key: objectKey, Body: fileBody, ContentType: "application/pdf" }));
Unlock the full snippet
This is a Pro snippet — get all-access for $19, or unlock just this one snippet for $1.
R2: Upload Object — Cloudflare Example (TypeScript, Node, Python, Go, PHP, Ruby) | apiexamples