Serving Files through r2 bucket showing error

Hi, i am trying to serve downloading links for my APK download website through r2 storage.

I followed all mentioned guide here:

Also i allowed bucket to public and already connect a subdomain for r2.

Public bucket url: https://pub-53a85ed060204062a812ac87cfc8d7e6.r2.dev

Connected domain: cdn.gamenewsmania.in

File i want to access: (testing file as png)
https://c61de5e5f4ad746137f28e74d968e1b3.r2.cloudflarestorage.com/file/unnamed-modified.png

But showing error
404 The specified key does not exist. And xml file error.

Please help me to solve this problem.

1 Like

Same here.
Any news on your side?

Tangential but related: while trying to upload a ~400MB file, I got an error message pointing to Cloudflare Status - Customer impacting issue related to R2 Storage's CopyObject API
But this was 10 days ago and is listed as resolved.

I’m fairly new to R2 and kind of lost for now.

1 Like

There’s not enough information to go off here - take a screenshot of your buckets public domain settings.

This just redirects to your root domain.

What was the actual error message?

Thanks for popping in.
Sorry for the delay.
Here’s my Bucket Access config:

And here’s what I get when visiting
https://pub-3ebb7669091440228005244c06940b28.r2.dev

I have tried to disallow+re-allow, but got the same result. At least it’s consistent. :wink:

Any thoughts?


Here’s the error message mentioned previously:

I get this when trying to upload a 407 MB file using Cyberduck. But this is probably worthy of another tread… Cyberduck might not be fully compliant with the S3 API.

1 Like

If you’re not providing a file path then that’s expected - public buckets do not have listing.

3 Likes

First you need to choose a subdomain for r2 bucket.

Like example.com is your main domain

So click on CONNECT DOMAIN

type-

cdn.yourdomainname.com

Now refresh the page and set bucket access to Public. Go to object and upload a file.

My file name is - 1654691.webp

So CDN url is - https://image.gamenewsmania.in/1654691.webp

OK, got it! Thank you, @KianNH
We simply need to add the file path (from the root of the bucket) to the Public Bucket URL.

For the sake of completeness, I’ll add to @user17043 comment’s that custom domain remains optional. It works on .r2.dev as well. Although, I’ve seen emails containing .dev links moved to spam by Gmail. Custom domain may be worth it in some scenarios.

Cheers!