45 questions
0
votes
1
answer
26
views
Why does CopyObject fail with "Header 'x-amz-tagging-directive' with value 'REPLACE' not implemented" for Cloudflare R2?
I'm trying to rename an object in an S3-compatible storage by copying it to a new key and then deleting the old one in Cloudflare R2. I'm using AWSSDK.S3 (4.0.13.1)
private (bool success, string ...
0
votes
0
answers
62
views
how to pass the uploaded assets URL directly to the front-end without using Presigned URL?
It's my first time using CDNs, and I went with Cloudflare R2 / S3 to upload and serve assets. I managed to upload an image to the path users/123456789/avatar-251011-103221008, this path is what I'm ...
0
votes
1
answer
46
views
How to send a file using ktor-client to R2 with `application/octet-stream` header?
I am trying to make PUT-request to r2.cloudflarestorage.com to upload a file like this:
curl --location --request PUT 'https://*.r2.cloudflarestorage.com/***' \
--header 'Content-Type: application/...
0
votes
0
answers
73
views
Why does CloudFlare R2 calculate a different SignatureV4 when using awssdk's S3AsyncClient
Using software.amazon.awssdk:s3:2.32.11 I started with the following code:
var objectKey = "test.txt";
var path = Path.of("/tmp/test/log.txt");
var credentials = ...
0
votes
1
answer
124
views
AWSSDK.S3 for Cloudflare R2 with .NET mismatch signature
I'm trying to use Cloudflare R2 for my .NET project with AWSSDK.S3
but I'm facing a problem:
The request signature we calculated does not match the signature you provided. Check your secret access ...
1
vote
0
answers
80
views
Cloudflare-proxied R2 endpoint pending forever for audio file
I'm developing a platform for users to upload and play audio. It's built in NextJS and uses Cloudflare R2 to handle the file storage. My R2 files are served to the client via a NextJS endpoint (/...
0
votes
0
answers
160
views
How to fix 401 Unauthorized when I use the AWS SDK with Cloudflare R2 Storage in Spring Boot example?
I have a problem about fixing 401 Unauthorized issue when I upload a file through Cloudflare R2 Storage in my Spring Boot example.
I get Token value, access key, secret key and jurisdiction-specific ...
1
vote
1
answer
325
views
How do I retrieve a PDF from R2 using a Cloudflare Worker?
I am porting a React SPA from a traditional nginx host to a Cloudflare worker, using the recently announced Vite Cloudflare plugin. This SPA needs to retrieve images and PDFs from R2. I have the image ...
0
votes
0
answers
45
views
Invalid Argument: X-Amz-Security-Token when my django-based website hosted by vercel tries to get static files from cloudflare r2
First of all: I have a R2 bucket on cloudflare that is public, allows any origins and any headers, and works completely fine.
I'm using django-storages to storage and retrieve static files from that ...
0
votes
0
answers
88
views
fsspec/s3fs rm followed by exists returns true
Why does fs.exists() sometimes return True even after deleting directories using fsspec/s3fs? Is there a reliable way to confirm directory deletion on Cloudflare R2 in python?
If I rclone lsf r2://...
0
votes
0
answers
17
views
How can I add allow only specific extension when using r2 with presigned url?
I use R2 with presigned url and want to know how can I check for extension like only allow image extension and no pdf etc.
nodejs:
app.post('/pre', async (req, res) => {
try {
const key = ...
0
votes
1
answer
438
views
Cloudflare R2 + Localhost + CORS Issue
I'm getting a pre signed url from my backend ( that uses amazon sdk to generate this )
After getting the pre signed url in the react client ( localhost:3000 ), the next step is to use this pre signed ...
1
vote
2
answers
763
views
Cloudflare R2 presigned url generation with aws sdk .net gives "SigV2 authorization is not supported"
I have the following code (almost the same as this docs page):
private static AmazonS3Client GetS3Client()
{
var credentials = new BasicAWSCredentials(accessKey, secretKey);
return new ...
0
votes
0
answers
32
views
R2 DeleteObjectCommand Always Returns 204 - Even for Non-Existent or Random Keys
I'm experiencing an unusual behavior with the DeleteObjectCommand in the AWS SDK for JavaScript (v3) when interacting with R2. When I call DeleteObjectCommand, it consistently returns a 204 status ...
1
vote
1
answer
245
views
vectorize.upstream_error - failed to parse upsert vectors request in ndjson format: line Some(0) was not expected format
I am trying to upsert a vector in my cloudflare vectorize index
For now I am testing from my terminal using cURL
Call I am making is this:
curl -v --request POST --url https://api.cloudflare.com/...
1
vote
1
answer
692
views
Cloudflare R2 Access Denied and Signature v2-v4 Problem
I am trying to use the AWS SDK for the Cloudflare R2. Here are my constructor codes and logs still I get the signature problem for POST requests.
I also can't able to GET any of my buckets. "...
-2
votes
1
answer
212
views
Cloudflare R2 to move data across AWS regions [closed]
I saw this tweet from @samgoodwin89 last week:
Cloudflare has no egress fees and AWS has no ingress fees.
Pay egress fees once to move data to R2 and now you can migrate data
to as many AWS regions ...
0
votes
0
answers
90
views
CompleteMultipartUploadCommand always return error R2 cloudflare
I try to use multipart upload. I already set CORS of the bucket. And do all step based on this Multipart uploads to Cloudlfare R2 + Workers
Upload init with reponse below
{"msg":"...
0
votes
0
answers
211
views
R2 cloudflare return same etag for all parts
I have a problem with multipart upload r2 cloudflare.
There is 3 steps, upload init, upload part, and upload complete.
Upload part code
const uploadId = url.searchParams.get('uploadId');
const ...
1
vote
1
answer
367
views
Is it possible to read file data for use in Vitest tests of Cloudflare Workers?
I have a Cloudflare Worker that interacts with an R2 bucket containing several data files. I want to write tests for this, but since Vitest isolates the tests from the development bucket, I need to be ...
0
votes
1
answer
813
views
Download and view images from Cloudflare R2
I am working on Sveltekit app using Typescript and want to display the images from R2, using workers R2 API, in the custom image component.
The following is the .svelte code
<script lang="ts&...
0
votes
1
answer
129
views
You are not authorized to view this object, Django + Cloudflare R2
im trying to use CloudFlare R2 to server static files from my django project, but im having "This object could not be viewed".
I added custom domains, and allowed public view. I cant ...
2
votes
1
answer
659
views
Cloudflare doesn't accept multiple bytes range
I have a large file deployed to R2, and want some portions of it.
Accordingly to MDN, the Range header can specify multiple ranges in the form of Range: bytes=0-10, 20,50. Anyway, when I try to make ...
1
vote
1
answer
1k
views
CORS Error Uploading File with Presigned URL (React/CloudFlare R2) - Preflight Response Issue
I'm encountering a CORS error when trying to upload a file using a presigned URL in my React application (using Axios) to CloudFlare R2 storage. The upload works fine in Postman, but the browser ...
0
votes
1
answer
541
views
Does making an R2 bucket public and using a custom domain eliminate the need for a CORS policy to access its data?
I'm considering hosting video content on an R2 bucket and want to ensure seamless access to this content across different domains. My plan is to make the R2 bucket's access public and connect it to a ...
1
vote
1
answer
880
views
CloudFlare R2 with Flutter
I want to use CloudFlre R2 as storage for my Flutter app.
I have AccessKey, SecertKey and r2Token.
Unfortunately, I cannot find a package or HTTP request to upload a file to an R2 bucket.
I tried ...
0
votes
1
answer
1k
views
R2: Setting CORS policy with different methods per allowed-origins
I’m having trouble with setting the correct CORS policy on my bucket on Cloudflare's R2.
What I want to achieve: the bucket may by accessed by via any webpage of any domain, but only with GET method ...
1
vote
1
answer
1k
views
Trouble Accessing FetchEvent in Hono JS Context on Cloudflare Workers
I'm developing a Cloudflare Workers application using Hono JS and encountering an issue where I'm unable to access FetchEvent within the Hono context. The application works fine with itty router and ...
0
votes
0
answers
703
views
Cloudflare R2 bucket access using postman
I am looking for how to access the Cloudflare R2 bucket in Postman so i can understand and use it in my way.
In other words; i want to know how can i access the r2 bucket and objects using the r2 url ...
2
votes
1
answer
1k
views
Why is my bucket name in my R2 object's key?
I am using Cloudflare R2 with @aws-sdk/client-s3 inside of a serverless function.
Here I attempt to add an object to my bucket ('my-bucket');
import { S3Client, PutObjectCommand } from "@aws-sdk/...
3
votes
3
answers
1k
views
Can we set Cloudflare R2 cache-control max-age?
Can we set the Cache-Control HTTP response header for our Cloudflare R2 buckets & objects? I could not find options in the web UI nor the AWS CLI "s3" and "s3api" commands. I'm ...
3
votes
2
answers
1k
views
Why doesn't CopyObject for CloudFlare R2 not work with the AWS SDK for .NET?
I'm trying to move my object between two buckets.
I execute a CopyRequest, then a DeleteRequest. But when I'm trying to copy the object, I get the following error:
Amazon.S3.AmazonS3Exception: Header ...
2
votes
0
answers
680
views
get SSLV3_ALERT_HANDSHAKE_FAILURE error when trying to connect to Cloudflare R2 through Postman
I'm 90% sure that this is a postman config issue, but I'll give other details in case they matter.
I'm testing out Cloudflare's APIs through postman, and I'm just trying to get the list of buckets. I ...
3
votes
2
answers
2k
views
Why do I get 401 Unauthorized when I use the AWS SDK with Cloudflare R2 Storage?
I'm trying to list objects in a Cloudflare R2 storage bucket using the AWS SDK for JavaScript (v3) in a Node.js application, but I'm encountering an 'Unauthorized' error.
Here is the code snippet that ...
3
votes
1
answer
1k
views
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:
...
4
votes
1
answer
1k
views
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.
2
votes
0
answers
1k
views
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(
"...
2
votes
1
answer
1k
views
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 ...
2
votes
0
answers
369
views
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 ...
1
vote
2
answers
5k
views
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 ...
9
votes
4
answers
9k
views
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 ...
1
vote
1
answer
479
views
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 ...
4
votes
1
answer
4k
views
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 ...
0
votes
2
answers
3k
views
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 ...
2
votes
1
answer
1k
views
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....