Cloudflare R2 Storage allows developers to store large amounts of unstructured data without the costly egress bandwidth fees associated with typical cloud storage services.
You can use R2 for multiple scenarios, including but not limited to:
To create a new R2 bucket from the Cloudflare dashboard:
You will receive a confirmation message after a successful upload.
For me, I create a bucket named test and I upload an image
I will access my image had been uploaded before
- In the bucket, I switch to the Setting tab
- In the Public access section, I will add a custom domain (ex: storage-test.example.com) Image 1
- It will take time to activate the custom domain (not too long)
- After active like Image 2, I can access my image with the URL in the browser: storage-test.example.com/image.png like Image 3
Note: When adding a custom domain in there, an A record with type R2 in the DNS of the domain in Cloudflare will be created like Image 4, and in opposition, when removing the custom domain, the record will be removed
If you only allow acessing for developers who can accesses it, you can enable R2.dev subdomain in the setting
Note: