Cloudflare R2 problem
-
Hello Thomas,
I have a problem with importing files from Cloudflare R2 using External files in Media Library 5.3.0 together with the S3-compatible platforms extension.
The connection to Cloudflare R2 works correctly. The plugin connects to the bucket, displays its directories and files, and allows me to select files for import.
The R2 bucket is publicly available through a Cloudflare R2 Custom Domain.
However, when I add a file from R2 to the WordPress Media Library, with “Import the external file as a real file” disabled, the plugin still downloads the physical file to the local WordPress uploads directory.
In File Info the file is correctly recognized as:
Source: Cloudflare R2
External file: Yes
but at the same time it shows:
Hosting: File is locally hosted
I would like the physical files to remain exclusively in Cloudflare R2 and WordPress Media Library to reference them as external files, without creating local copies.
I have also checked the plugin code while troubleshooting. It appears that the Cloudflare R2 integration determines whether a file is public by checking the R2 storage/API endpoint. In my configuration, however, public access is provided through a Cloudflare R2 Custom Domain, so the file appears to be classified as non-public and consequently as locally hosted.
Could you please confirm whether Cloudflare R2 Custom Domains are currently supported for external files without local copies?
If so, how should the Custom Domain be configured in the plugin?
If this is currently not supported, would it be possible to add support for a Cloudflare R2 Custom Domain / public URL?
My intended setup is to use one central Cloudflare R2 media repository for several WordPress/WooCommerce websites, with each website referencing the same external media files without storing its own physical copies.
Thank you for your help.
You must be logged in to reply to this topic.