Offloading media to Cloudflare R2

หน้านี้ยังไม่มีคำแปลภาษาไทย — แสดงฉบับภาษาอังกฤษไปก่อน

Create the bucket

  1. In the Cloudflare dashboard, open R2 Object Storage and create a bucket.
  2. Create an API token scoped to that bucket with Object Read & Write.
  3. Optional but recommended: connect a custom domain (or enable the r2.dev subdomain) so files can be served publicly.

Connect MediaDock

Under Media → MediaDock → Storage locations, add a location, pick the Cloudflare R2 preset, and fill in your account endpoint, bucket and keys. For better security, put the keys in wp-config.php instead:

define( 'MDK_STORAGE_R2_KEY', '...' );
define( 'MDK_STORAGE_R2_SECRET', '...' );

Click Test connection — you should see "Connection OK."

Move files

  • Right-click any folder → Move files to → your location, or
  • offload the entire library from the storage settings.

Every file is copied, verified by checksum, and only then removed locally ("Move" mode) — or kept locally too ("Mirror" mode). Bring files back to local reverses everything byte-for-byte.