# Cloudflare R2 Storage Issues

**URL:** https://meta.discourse.org/t/cloudflare-r2-storage-issues/376465
**Category:** Support
**Created:** [July 29, 2025, 6:29pm UTC](https://meta.discourse.org/t/cloudflare-r2-storage-issues/376465 "2025-07-29T18:29:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DonBot](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DonBot](https://meta.discourse.org/u/DonBot)
#### Post date: [July 29, 2025, 6:29pm UTC](https://meta.discourse.org/t/cloudflare-r2-storage-issues/376465/1 "2025-07-29T18:29:53Z")

</div>

Hi,

I setup Cloudflare R2 as the S3 bucket for file uploads. Images upload and load properly. However files upload but do not load properly for download.

My API URL looks like:

[http://d9d](http://d9d)………..r2.cloudflarestorage.com/jtechforums-storage

My CDN URL looks like:

[https://pub-c5c38](https://pub-c5c38)…..9bc6cb.r2.dev/jtechforums-storage

Images load properly, however when trying to download files, the file URL it takes me to is:

[https://jtechforums-storage.jtechforums-storage/original/2X/a/a55867475418180f5c6e62b572ad5769a78ac548.pdf](https://jtechforums-storage.jtechforums-storage/original/2X/a/a55867475418180f5c6e62b572ad5769a78ac548.pdf)

Why does that happen?

Attached are my S3 settings.

 ![Screenshot 2025-07-29 at 2.27.34 PM](https://global.discourse-cdn.com/meta/original/4X/f/6/e/f6e21ae7e87c71875fd792347f7db6e64c8205af.png)

 ![Screenshot 2025-07-29 at 2.27.39 PM](https://global.discourse-cdn.com/meta/original/4X/9/b/e/9bec1281a2158c16e1f47361a63c134d3d7c01ae.png)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 29, 2025, 8:31pm UTC](https://meta.discourse.org/t/cloudflare-r2-storage-issues/376465/2 "2025-07-29T20:31:39Z")

</div>

I"m not quite sure, but I recommend that you put your S3 settings in ENV variables as described at [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916). You’re likely to have trouble restoring a backup with the settings in the database.

Also, if you do have them in `app.yml` and have the backup on S3, then you need only the yml file to set up a new server and restore the database.

If it’s possible, sharing a topic where you have this problem will give someone trying to see what’s going on a lot more information. If your site is public, then the only thing you need to hide are your keys, which are already hidden.
