cloudflare · Cloudflare Workers Docs
Workers Securely access and upload assets with Cloudflare R2
A step-by-step tutorial for building a TypeScript Cloudflare Worker that integrates with R2 storage to perform secure file fetching and uploading operations.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Securely access and upload assets with Cloudflare R2
A step-by-step tutorial for building a TypeScript Cloudflare Worker that integrates with R2 storage to perform secure file fetching and uploading operations.
When To Use
Use when you need to implement a secure workflow for reading from and writing files to Cloudflare R2 storage using a Cloudflare Worker.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-upload-assets-with-r2-securely-access-and-cloudflare-workflow-guide.md | A TypeScript tutorial demonstrating how to create a Cloudflare Worker that securely reads from and writes files to a Cloudflare R2 bucket. | Questions about a TypeScript tutorial demonstrating how to create a Cloudflare Worker that securely reads from and writes files to a... |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare-.text | A command-line instruction to initialize a Cloudflare Workers project specifically configured for uploading assets to R2 storage. | Exact payloads, commands, or snippets shown in A command-line instruction to initialize a Cloudflare Workers project specifically configured for uploading assets to... |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--2.text | The shell command used to initialize the project for uploading assets to Cloudflare R2 using the Cloudflare Workers CLI. | Exact payloads, commands, or snippets shown in The shell command used to initialize the project for uploading assets to Cloudflare R2 using the Cloudflare Workers CLI. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--3.text | The pnpm command used to initialize a new Cloudflare Workers project for uploading assets to R2. | Exact payloads, commands, or snippets shown in The pnpm command used to initialize a new Cloudflare Workers project for uploading assets to R2. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--4.text | A step-by-step guide and command sequence for setting up a local environment to upload assets to Cloudflare R2 using Workers. | Exact payloads, commands, or snippets shown in A step-by-step guide and command sequence for setting up a local environment to upload assets to Cloudflare R2 using... |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--5.text | A wrangler cli command to create a new Cloudflare R2 bucket. | Exact payloads, commands, or snippets shown in A wrangler cli command to create a new Cloudflare R2 bucket. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--6.text | A wrangler cli command used to list available Cloudflare R2 buckets. | Exact payloads, commands, or snippets shown in A wrangler cli command used to list available Cloudflare R2 buckets. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--7.text | A wrangler.toml configuration snippet defining an R2 bucket binding for a Cloudflare Workers project. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration snippet defining an R2 bucket binding for a Cloudflare Workers project. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--8.text | A configuration snippet showing how to define an R2 bucket binding within a Cloudflare Workers wrangler configuration. | Exact payloads, commands, or snippets shown in A configuration snippet showing how to define an R2 bucket binding within a Cloudflare Workers wrangler configuration. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--9.text | A TypeScript code example demonstrating how to use the R2Bucket interface within a Cloudflare Worker to retrieve objects from a bucket. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the R2Bucket interface within a Cloudflare Worker to retrieve obje... |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--10.text | Command to securely store an authentication secret in Cloudflare Workers using the Wrangler CLI. | Exact payloads, commands, or snippets shown in Command to securely store an authentication secret in Cloudflare Workers using the Wrangler CLI. |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--11.text | A TypeScript implementation of a Cloudflare Worker that uses a secret token to authenticate and upload assets to an R2 bucket. | Exact payloads, commands, or snippets shown in A TypeScript implementation of a Cloudflare Worker that uses a secret token to authenticate and upload assets to an R... |
examples/workers-upload-assets-with-r2-securely-access-and-cloudflare-cloudflare--12.text | The wrangler deploy command used to deploy the Cloudflare Worker for R2 asset management. | Exact payloads, commands, or snippets shown in The wrangler deploy command used to deploy the Cloudflare Worker for R2 asset management. |
What This Skill Covers
- This tutorial explains how to create a TypeScript-based Cloudflare Workers project that can securely access files from and upload files to a Cloudflare R2 bu...
- Main sections:
Tags,Prerequisites,Create a Worker application,Create an R2 bucket,Configure access to an R2 bucket.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/tutorials/upload-assets-with-r2
