Different ObjectURL result when using MultipartUploader compared to putObject

I have a service that is uploading files to R2 which is using aws-sdk-php and MultipartUploader.

I was previously using putObject but noticed with large files it took a rediculous amount of time to upload and would timeout (after 15 mins for a 1.4GB file).

I’ve now noticed since the switch that the URL returned in ObjectURL is massively different from putObject which is having knock-on effects for other processes.

In my S3Client($Options) I have the following set.

$options = [
    'region' => 'auto',
    'endpoint' => 'https://<my_account_id>.eu.r2.cloudflarestorage.com',
    'version' => 'latest',
    'credentials' => $credentials
];

This works fine when using putObject (with bucket name specified) and would result in an ObjectURL of

https://<bucket_name>.<account_id>.eu.r2.cloudflarestorage.com/filename.pdf

Using the same defined S3Client() as above with MultipartUpload is produces an ObjectURL of

https://<account_id>.r2.cloudflarestorage.com/<bucket_name>/filename.pdf
  • Why is the ObjectURL so different?
  • Why is not accessible via the same structured URL as putObject when they’re in the same jurisdiction, bucket and account?

There is an external service that downloads the uploaded files from my R2 and has https://<bucket_name>.<account_id>.eu.r2.cloudflarestorage.com/ pre-programmed as a prefix for files so it’s failing when it comes to download files that have been uploaded to R2 using the alternative MultipartUpload.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.