跳到正文
文章入门

用 Cloudflare R2 安全地访问和上传文件

创建一个 TypeScript Worker,安全地从 Cloudflare R2 存储桶读取文件并向其上传文件。

最近更新
2026年10月12日
阅读原文

该介绍目前仅提供英文版本。

R2 stores large amounts of unstructured data without egress fees. This tutorial binds a bucket to a Worker, serves files from it, and adds an upload route that only accepts requests with an Authorization header matching your secret.

What you’ll learn

  • Create an R2 bucket and bind it to a Worker
  • Fetch objects from the bucket
  • Upload securely with an authorization check
  • Deploy

Cloudflare products used

R2, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

继续学习