PHP Client for Cloudflare API
R2

Local Uploads

Local uploads for an R2 bucket.

Local uploads for an R2 bucket.

Get

Get the local uploads configuration for a bucket.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount Identifier.
bucketNamestringYesBucket Name.
php
$response = $client->r2()->localUploads()->get('ACCOUNT_ID', 'BUCKET_NAME');
View this operation on the Cloudflare API Reference

Update

Turn local uploads on or off for a bucket.

ParamTypeRequiredDefaultDescription
accountIdstringYesAccount Identifier.
bucketNamestringYesBucket Name.
enabledboolYesWhether to enable local uploads for this bucket.
php
$response = $client->r2()->localUploads()->update('ACCOUNT_ID', 'BUCKET_NAME', true);
View this operation on the Cloudflare API Reference
Copyright © 2026