Upload objects
You can upload objects to your bucket from the Cloudflare dashboard or using the Wrangler.
Rclone is a command-line tool which manages files on cloud storage. You can use Rclone to upload objects to R2. To use Rclone, install it onto your machine:
To install on a Mac device, install with brew
.
brew install rclone
To install on a Windows device, download it from the official Rclone website ↗.
First, configure your Rclone with the following settings.
- Create new remote by selecting
n
. - Select a name for the new remote. For example, use
r2
. - Select the
Amazon S3 Compliant Storage Providers
storage type. - Select
Cloudflare R2 storage
for the provider. - Select whether you would like to enter AWS credentials manually, or get it from the runtime environment.
- Enter the AWS Access Key ID.
- Enter AWS Secret Access Key (password).
- Select the region to connect to (optional).
- Select the S3 API endpoint.
Upload your files to R2.
# Upload a single file.# Specify the target bucket with this syntax: <remote name>:<bucket name># In this example, <remote name> is 'r2'rclone copy /path/to/local/file.txt r2:bucket_name
# Upload everything in a directoryrclone copy /path/to/local/folder r2:bucket_name
Verify that your files have been uploaded by listing the objects stored in the destination R2 bucket.
rclone ls r2:bucket_name
To upload objects to your bucket from the Cloudflare dashboard:
- Log in to the Cloudflare dashboard ↗ and select R2.
- From the R2 page in the dashboard, locate and select your bucket.
- Select Upload.
- Choose to either drag and drop your file into the upload area or select from computer.
You will receive a confirmation message after a successful upload.
To upload a file to R2, call put
and provide a name (key) for the object, as well as the path to the file via --file
:
wrangler r2 object put test-bucket/dataset.csv --file=dataset.csv
Creating object "dataset.csv" in bucket "test-bucket".Upload complete.
You can set the Content-Type
(MIME type), Content-Disposition
, Cache-Control
and other HTTP header metadata through optional flags.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark