Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-upload-assets-with-r2-securely-access-and-cloudflare-workflow-guide.mdA 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-.textA 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.textThe 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.textThe 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textCommand 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.textA 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.textThe 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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