Upload objects
You can upload objects to your bucket from the Cloudflare dashboard or using the Wrangler.
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
:
You can set the Content-Type
(MIME type), Content-Disposition
, Cache-Control
and other HTTP header metadata through optional flags.