Cloudflare's R2 product, currently in beta, is a partially-S3 compatible object storage service.
Questions tagged [cloudflare-r2]
15 questions
3
votes
2 answers
Cloudflare R2 - Delete all objects from bucket
Is there an easy way to delete all objects from a Cloudflare R2 bucket?
This isn't something I'd want to do in production, but something that I want to do while testing in development. I'd love to be able to select more than 25 objects at a time…

Phil-6
- 552
- 6
- 16
3
votes
1 answer
How to set a custom header using @aws-sdk/client-s3?
Cloudflare's R2 has an extension that prevents a NoSuchBucket error, by creating the bucket if it does not exist. To enable it, you're supposed to add a cf-create-bucket-if-missing: true header on the PutObject request. Can this header be set if…

ambiguous58
- 1,241
- 1
- 9
- 18
2
votes
0 answers
Get Cloudflare R2 Public URL after uploading file using boto3
Is there a way to upload a file to Cloudflare R2 storage using boto3 in Python, and get the public URL that it can be accessed at?
The files are being uploaded by doing
s3 = boto3.resource(
"s3",
endpoint_url=endpoint_url,
…

gameveloster
- 901
- 1
- 6
- 18
2
votes
1 answer
Clouflare R2 with Firebase
I'd like to integrate the Cloudflare R2 (object storage) with my Firebase project.
Normally you would use Firebase Storage but since Google Cloud has some insanely high egress fees, I'd prefer to use Cloudflare R2 as a storage option.
Do you know if…

Ole Mai
- 21
- 1
2
votes
1 answer
Error: Network Connection Lost - saving form data (file) to R2 bucket
I have this handler in my worker:
const data = await event.request.formData();
const key = data.get('filename');
const file = data.get('file');
if (typeof key !== 'string' || !file) {
return res.send(
{ message: 'Post body is not valid.' },
…

Andy Jessop
- 225
- 1
- 13
1
vote
0 answers
Cloudflare R2 403 on redirect from express JS
When a user asks for a resource, I redirect them to that resource on cloudflare R2. R2 bucket is behind my own DNS (if that can help or I can change something there).
The issue I am facing is a 403 Forbidden on the preflight. "Request method:…

mbenchekroun
- 21
- 2
1
vote
0 answers
Can I build a globally distributed lock with Cloudflare R2?
From the docs, R2 seems to be globally replicated and strongly consistent: https://developers.cloudflare.com/r2/data-access/workers-api/workers-api-reference/#bucket-method-definitions
Does that mean I can create a Globally redundant distributed…

marti H
- 45
- 5
1
vote
1 answer
Cloudflare R2 Worker throwing 'Network Connection Lost' error
In my worker I am converting a base64 string I get from the request to a blob with some function. However, when I try to PUT the blob into my bucket, I get "Network Connection Lost" error. I can successfully PUT just the base64 string or any other…

brandon
- 21
- 3
0
votes
0 answers
Problem uploading files to cloudflare r2 with ASP.NET Core Web API
I want to make a small API, but I could not solve the problem.
I created a simple ASP.NET Core Web API project. I'm trying to upload files to cloudflare r2 using AWSSDK but I'm getting an error.
Code:
using Amazon.Runtime;
using Amazon.S3;
using…

fbdev1907
- 45
- 1
- 7
0
votes
0 answers
Cloudflare R2 returning zeros in stream using workers and pages
I am looking to use R2 as a store for a data structure that is a 2D array of Uint32, but when I read the stored object from my worker, I am receiving unexpected results.
The goal is to create a worker that receives a series of updates as JSON, reads…

Jefferey Cave
- 2,507
- 1
- 27
- 46
0
votes
0 answers
Is this the correct way to obtain an AWS read-only presigned URL in Node.js?
import { S3Client, GetObjectCommand, S3ClientConfig } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
const s3Configuration: S3ClientConfig = {
credentials: {
accessKeyId: '',
…

Pratham
- 53
- 3
0
votes
0 answers
Cloudflare R2 : get usage metrics through the API
I can't find how to get usage metrics to my R2 bucket through cloudflare's API.
I'd like to get the bucket size and the number of class A and class B operations.
Thanks !
0
votes
0 answers
How to migrate app data from backblaze to cloudflare R2 softly?
now all my apps are using backblaze as storage, Cloudflare only as DNS (CNAME → test001-b2.test.com → f002.backblazeb2.com)
now I want to migrate storage from backblaze to Cloudflare R2 softly, without app upgrade. (I already sync data between two…

Xun Lee
- 313
- 1
- 3
- 12
0
votes
1 answer
Generate signed URL for R2 from Cloudflare worker
I am trying to replicate the result from this guide: https://developers.cloudflare.com/r2/data-access/s3-api/presigned-urls/
However, with the exact same code, the signedUrl variable return empty object({}).
If anyone has any insight would be much…

harpy
- 1
- 1
0
votes
2 answers
Is cloudflare R2 able to handle HLS streaming?
https://hlsbook.net/how-to-serve-hls-video-from-an-s3-bucket/
It is quite simple to setup a bucket folder on S3 to stream a video HLS download. I wonder is cloudflare R2 able to do this? I am able to setup a public folder with R2 that can deliver a…

learncodes123
- 371
- 3
- 16