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 uploads and fetches.
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 uploads and fetches.
When To Use
Use when you need to implement a secure workflow for uploading and retrieving unstructured data from Cloudflare R2 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-index-securely-access-and-cloudflare-workflow-guide.md | A tutorial guide for creating a TypeScript-based Cloudflare Workers project to securely access and upload files to a Cloudflare R2 bucket. | Questions about a tutorial guide for creating a TypeScript-based Cloudflare Workers project to securely access and upload files to a... |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud.text | The npm command used to initialize the Cloudflare Workers project for uploading assets to R2. | Exact payloads, commands, or snippets shown in The npm command used to initialize the Cloudflare Workers project for uploading assets to R2. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-2.text | A command-line instruction for initializing a Cloudflare Workers project to upload assets to R2 storage using the yarn create cloudflare command. | Exact payloads, commands, or snippets shown in A command-line instruction for initializing a Cloudflare Workers project to upload assets to R2 storage using the yar... |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-3.text | The pnpm command used to initialize the Cloudflare Workers project for uploading assets to R2. | Exact payloads, commands, or snippets shown in The pnpm command used to initialize the Cloudflare Workers project for uploading assets to R2. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-4.text | A step-by-step guide and command sequence for setting up a Cloudflare Workers project to securely access and upload assets to R2 storage. | Exact payloads, commands, or snippets shown in A step-by-step guide and command sequence for setting up a Cloudflare Workers project to securely access and upload a... |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-5.text | A CLI command using wrangler to create a new Cloudflare R2 bucket. | Exact payloads, commands, or snippets shown in A CLI command using wrangler to create a new Cloudflare R2 bucket. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-6.text | A wrangler cli command used to list all available R2 buckets in a Cloudflare account. | Exact payloads, commands, or snippets shown in A wrangler cli command used to list all available R2 buckets in a Cloudflare account. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-7.text | A wrangler.toml configuration file defining an R2 bucket binding for a Cloudflare Workers project. | Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining an R2 bucket binding for a Cloudflare Workers project. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-8.text | A configuration snippet showing how to define an R2 bucket binding within a wrangler.toml file. | Exact payloads, commands, or snippets shown in A configuration snippet showing how to define an R2 bucket binding within a wrangler.toml file. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-9.text | A Cloudflare Worker script that retrieves an object from an R2 bucket based on the request URL pathname. | Exact payloads, commands, or snippets shown in A Cloudflare Worker script that retrieves an object from an R2 bucket based on the request URL pathname. |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-10.text | A command-line instruction for setting an AUTH_SECRET environment variable using the Wrangler CLI to secure R2 asset uploads. | Exact payloads, commands, or snippets shown in A command-line instruction for setting an AUTHSECRET environment variable using the Wrangler CLI to secure R2 asset u... |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-11.text | A JavaScript worker implementation that uses an authentication secret to securely authorize and perform PUT requests to a Cloudflare R2 bucket. | Exact payloads, commands, or snippets shown in A JavaScript worker implementation that uses an authentication secret to securely authorize and perform PUT requests... |
examples/workers-upload-assets-with-r2-index-securely-access-and-cloudflare-cloud-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/index.md
