Create expiring R2 download or upload links in WHMCS

Skip to main content
Print

Create expiring R2 download or upload links in WHMCS

PD Cloudflare R2’s Share links section creates a URL for one object and operation. It lets a recipient use that link without receiving the service’s S3 secret.

Generate the link

  1. Open the intended service’s Share links section.
  2. Select the service bucket and enter the exact object key, including any folder-like prefix.
  3. Choose the offered download or upload operation and an expiry.
  4. Generate the URL and copy it privately.
  5. Verify it with the intended client and operation before distributing it.

A download uses GET for an existing object. An upload uses PUT for its specified object key; it is not a browser HTML-form POST upload. Uploading to a key that already exists can overwrite it, and R2 does not provide S3 object versioning to recover that overwrite through this module.

Treat the complete URL as access

Anyone holding a valid link can perform its signed operation until it expires or its credential becomes invalid. It is not automatically single-use. Use a short useful lifetime and avoid putting the URL in analytics, public pages or support tickets.

Do not rewrite the signed S3 hostname to a custom domain. Signing covers the request details. Changing the method, object key or relevant headers can invalidate the signature; follow the recipient application’s required request format.

Diagnose browser failures separately

A browser upload may need an appropriate bucket CORS rule even when the same signed URL works outside a browser. Use the CORS guide and Cloudflare’s presigned URL reference to separate browser-origin policy from authentication.

Rotation, suspension or termination can invalidate access before the link’s displayed expiry. Inspect current service state rather than repeatedly extending a refused link.

See the PD Cloudflare R2 WHMCS guide for related tasks, or explore the module.

Table of Contents

Get your website online with PD Hosting

UK hosting, domains and support from a real team. From a first site to a full server.

Terms and Conditions  ·  Privacy Policy

PD Hosting is the trading name of Projektif Digital Ltd, registered in England and Wales, company number 12482555.

PD Hosting
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.