r2-storage
r2-storage provides S3-compatible object storage through Cloudflare R2, enabling you to upload, download, and manage files, images, videos, and structured data. The skill includes patterns for multipart uploads, conditional operations, custom metadata, range requests, and AWS SDK integration.
r2-storage lets you store and retrieve files, images, and large data using Cloudflare's S3-compatible object storage.
AI-generated summary based on this skill's SKILL.md
Install
null-shot/cloudflare-skills/r2-storage · repository language: TypeScript
git clone https://github.com/null-shot/cloudflare-skills
cp -r cloudflare-skills/r2-storage ~/.claude/skills/r2-storageFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is r2-storage and how does it work?
r2-storage provides S3-compatible object storage through Cloudflare R2, enabling you to upload, download, and manage files, images, videos, and structured data. The skill includes patterns for multipart uploads, conditional operations, custom metadata, range requests, and AWS SDK integration.
How do I upload files to r2 using presigned URLs?
r2-storage supports presigned URLs for secure, direct file uploads without exposing your credentials. You can generate time-limited URLs that allow clients to upload files directly to R2 buckets. The skill also handles multipart transfers for large files, enabling efficient resumable uploads and reducing bandwidth overhead.
Can I migrate my existing S3 workflows to r2?
Yes. r2-storage is designed for seamless migration from S3 to Cloudflare R2 with AWS SDK compatibility. Your existing S3 code can work with R2 by changing the endpoint configuration, making it straightforward to adopt R2 without rewriting application logic.
What file types and data can r2-storage handle?
r2-storage handles files, images, videos, documents, and large structured data at scale. It supports object metadata management, conditional operations using ETags, and range requests for efficient partial-file retrieval. You can also host static assets and maintain backup archives in R2 buckets.
How does r2-storage manage object metadata and conditional operations?
r2-storage enables efficient metadata storage and conditional operations using ETags and other HTTP headers. You can set custom metadata on objects, perform conditional reads and writes based on object state, and use range requests to retrieve specific byte ranges without downloading entire files.
Can I use r2-storage with Cloudflare Workers?
Yes. r2-storage integrates with Cloudflare Workers, allowing you to store and retrieve files directly from your worker code. This enables dynamic file handling, direct client uploads, and seamless asset hosting within your worker applications.
SKILL.md
rendered from the published skill — quoted content, verbatim
R2 Object Storage
Store and retrieve objects at scale using Cloudflare's S3-compatible object storage.
When to Use
- File uploads (images, videos, documents)
- AI assets and model artifacts
- Image and media asset storage
- Structured data (JSON, CSV, logs)
- User-facing uploads and downloads
- Static asset hosting
- Backup and archival storage
- S3-compatible workflows with existing tools
FIRST: Create R2 Bucket
# Create bucket
wrangler r2 bucket create my-bucket
# Create with location hint
wrangler r2 bucket create my-bucket --location wnam
# List buckets
wrangler r2 bucket list
Quick Reference
| Operation | API |
|---|---|
| Upload object | await bucket.put(key, data, { httpMetadata }) |
| Download object | const obj = await bucket.get(key); const data = await obj.text() |
| Delete object | await bucket.delete(key) |
| List objects | `const |
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 5 files
r2-storage/SKILL.md
r2-storage/references/limits.md
r2-storage/references/operations.md
r2-storage/references/s3-compat.md
r2-storage/references/testing.md