Upload objects
You can upload objects to your bucket from using API (both Workers Binding API or compatible S3 API), rclone, Cloudflare dashboard, or Wrangler.
Rclone is a command-line tool which manages files on cloud storage. You can use rclone to upload objects to R2. Rclone is useful if you wish to upload multiple objects concurrently.
To use rclone, install it onto your machine using their official documentation - Install rclone ↗.
Upload your files to R2 using the rclone copy
command.
# Upload a single filerclone 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 using rclone ls
command.
rclone ls r2:bucket_name
For more information, refer to our rclone example.
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