Download objects

Last updated Aug 6, 2026 You can download objects from R2 using the dashboard, Workers API, S3 API, or command-line tools.

Download via dashboard

  1. In the Cloudflare dashboard, go to the R2 object storage page. Go to Overview ↗
  2. Select your bucket.
  3. Locate the object you want to download.
  4. Select ... for the object and click Download.

Download via Workers API

Use R2 bindings in Workers to download objects:

export default {
    async fetch(request: Request, env: Env, ctx: ExecutionContext) {
        const object = await env.MY_BUCKET.get("image.png");
        if (object === null) {
            return new Response("Object not found", { status: 404 });
        }
        return new Response(object.body);
    },
} satisfies ExportedHandler<Env>;

For complete documentation, refer to Workers API.

Download via S3 API

Use S3-compatible SDKs to download objects. You'll need your account ID and R2 API token.

import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";

const S3 = new S3Client({
    region: "auto", // Required by SDK but not used by R2
    // Provide your Cloudflare account ID
    endpoint: `https://<ACCOUNT_ID>.r2.cloudflarestorage.com`,
    // Retrieve your S3 API credentials for your R2 bucket via API tokens (see: https://developers.cloudflare.com/r2/api/tokens)
    credentials: {
        accessKeyId: '<ACCESS_KEY_ID>',
        secretAccessKey: '<SECRET_ACCESS_KEY>',
    },
});

const response = await S3.send(
    new GetObjectCommand({
        Bucket: "my-bucket",
        Key: "image.png",
    }),
);
import boto3

s3 = boto3.client(
    service_name="s3",
    # Provide your Cloudflare account ID
    endpoint_url=f"https://{ACCOUNT_ID}.r2.cloudflarestorage.com",
    # Retrieve your S3 API credentials for your R2 bucket via API tokens (see: https://developers.cloudflare.com/r2/api/tokens)
    aws_access_key_id=ACCESS_KEY_ID,
    aws_secret_access_key=SECRET_ACCESS_KEY,
    region_name="auto", # Required by SDK but not used by R2
)

response = s3.get_object(Bucket="my-bucket", Key="image.png")
image_data = response["Body"].read()

Refer to R2's S3 API documentation for all S3 API methods.

Presigned URLs

For client-side downloads where users download directly from R2, use presigned URLs. Your server generates a temporary download URL that clients can use without exposing your API credentials.

  1. Your application generates a presigned GET URL using an S3 SDK
  2. Send the URL to your client
  3. Client downloads directly from R2 using the presigned URL

For details on generating and using presigned URLs, refer to Presigned URLs.

Download via Wrangler

Use Wrangler to download objects. Run the r2 object get command:

wrangler r2 object get test-bucket/image.png

The file will be downloaded into the current working directory. You can also use the --file flag to set a new name for the object as it is downloaded, and the --pipe flag to pipe the download to standard output (stdout).

Was this helpful?

YesNo

On this page

Download objects - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/r2/objects/download-objects/#page","headline":"Download objects","description":"Download objects from R2 using the dashboard, Workers API, S3 API, or CLI tools.","url":"https://developers.cloudflare.com/r2/objects/download-objects/","inLanguage":"en","image":"https://developers.cloudflare.com/r2/objects/download-objects/og.png?v=71b42c2af7a95765","dateModified":"2026-08-06","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Upload objects to R2 using single-part or multipart uploads via the dashboard, Workers API, or S3 API. title: Upload objects image: https://developers.cloudflare.com/r2/objects/upload-objects/og.png?v=fca7840785e7dbcc


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/r2/llms.txt
Use this file to discover all available pages before exploring further.