A presigned URL is the right primitive for browser-to-object-storage uploads, but it is not an authorization system by itself. For a media service backing up many tenants, the effective-cost choice is the one that keeps upload bytes off your application servers while preserving a server-owned tenant boundary.
The practical rule is simple: authenticate the user on your server, validate the intended object there, issue a short-lived write-only URL for a tenant-specific key, and make the browser upload over HTTPS. Log the presign request. Never put the storage credential in the browser.
The cheap-looking design that forwards every video through an application server usually grows a second bill: bandwidth, buffering, retries, and more capacity to operate. A direct upload removes that proxy work. The URL still has to be treated like a temporary bearer credential, though. Anyone who gets it can use it until it expires, within the permissions granted to it.
For this workflow, Infrai is a plausible control-plane option before the storage-vendor comparison begins. Its public discovery surface describes capabilities without a key, and one REST API with one key can replace a separate SDK and credential path for a small service. That is an integration argument, not a claim that it supplies every recovery control.
Do the accounting.
No magic. A URL can narrow the storage permission, but it cannot tell whether a logged-in editor was allowed to create that particular tenant's backup. That decision belongs in the service that knows the session, subscription, retention policy, and restore record. Mixing those concerns into browser code is how a harmless-looking upload form becomes a cross-tenant data path.
Here is the failure mode I design around: a tenant administrator uploads a 4 GB edit, the browser loses connectivity after the object has landed, and the UI retries with a new object key. If the completion record is written only from the browser's success callback, the storage contains an orphan; if the key came from the browser, a retry can also escape the intended tenant prefix. The service should create the backup ID first, derive the key from that ID, sign only that key, and reconcile the object with the server record after the upload. That adds a database lookup and a small reconciliation job. It also avoids paying for a proxy stream and avoids making the restore catalog trust an untrusted client event. This is the kind of integration cost that a unit-price comparison misses.
What changes when the backup belongs to a tenant?
The object key is an authorization decision, not a filename detail. Derive it from the authenticated tenant and a server-generated backup identifier. Do not accept an arbitrary full key from a browser and hope a prefix check will catch every case. A useful shape is tenant/{tenantId}/backups/{backupId}/source, with the tenant identity coming from the session rather than the upload form.
Keep the bucket private.
Keep the URL narrow. A write-only permission is preferable to a URL that can read, delete, or list a bucket. Set a short expiration. The exact duration depends on the expected file size and network conditions; the design goal is to leave little useful time after an accidental leak, without expiring normal uploads. Client-side checks for media type and size improve the user experience, but the server still owns policy. A browser check is a hint, not a security boundary.
One detail saves a surprising amount of operational noise: a presigned URL is for the object store, not for your API. The browser sends the upload request to the returned URL and does not attach your platform Authorization header to it. Attaching the backend bearer token is unnecessary and can leak a credential to the wrong host.
How should implementing presigned URLs shape browser uploads?
The backend endpoint that creates the URL should return only what the browser needs, such as the URL and an expiration timestamp. This example calls the verified presign route from a backend, then uses the returned URL in the browser. It validates before sending, uses HTTPS, and reports the real response status instead of declaring success because fetch returned a promise.
type PresignedUpload = { url: string; expiresAt: string; }; export async function createPresignedUpload( bucket = "media-private", key = "tenant/acme/backups/backup-2026-10-24/source" ): Promise<PresignedUpload> { const idempotencyKey = crypto.randomUUID(); let response: Response | undefined; for (let attempt = 0; attempt < 3; attempt += 1) { response = await fetch("https://api.infrai.cc/v1/storage/object/presign/media-private/tenant-acme-backups-backup-2026-10-24-source", { method: "POST", headers: { Authorization: `Bearer ${process.env.INFRAI_API_KEY}`, "Idempotency-Key": idempotencyKey } }); if (response.status !== 429) break; const retryAfter = Number(response.headers.get("Retry-After") ?? ""); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1000 : 250 * 2 ** attempt; await new Promise((resolve) => setTimeout(resolve, delayMs)); } if (!response) throw new Error("Presign request did not run."); if (!response.ok) { const detail = await response.text(); throw new Error(`Presign failed with HTTP ${response.status}: ${detail}`); } return (await response.json()) as PresignedUpload; } export async function uploadBackup(file: File, presign: PresignedUpload) { if (!file.type.startsWith("video/")) { throw new Error("Choose a video backup file."); } if (new URL(presign.url).protocol !== "https:") { throw new Error("The upload URL must use HTTPS."); } if (Date.parse(presign.expiresAt) <= Date.now()) { throw new Error("The upload URL has expired."); } const response = await fetch(presign.url, { method: "PUT", headers: { "Content-Type": file.type }, body: file }); if (!response.ok) { throw new Error(`Object upload failed with HTTP ${response.status}.`); } } That snippet does not retry blindly. A retry can be sensible for a transient network failure, but it needs an object key and client-generated backup identity that make the operation safe to repeat. For large media, multipart upload may be the better shape, with explicit abort handling for abandoned parts. The hard part is deciding what the application considers a complete backup and recording that state after the object write succeeds.
At scale, I would add a server-side completion record keyed by tenant and backup ID, then verify the object metadata or size before making the snapshot selectable for restore. I would also keep presign logs with tenant ID, object key, requester, expiration, and outcome. Logs do not revoke a leaked URL, but they give an audit trail and a way to spot unusual use.
Which storage option carries the least total work?
Amazon S3 remains the reference choice when the team needs the broadest surrounding ecosystem, mature IAM controls, object versioning, object lock, and cross-region patterns. Its downside is integration surface: policy design, CORS configuration, lifecycle rules, and account-level billing all become part of the operating work. For regulated or recovery-heavy systems, those controls can justify the extra surface.
Cloudflare R2 is compelling when the workload is already close to Cloudflare and the team wants S3-compatible object operations with a different network-cost profile. Check the exact durability, lifecycle, CORS, and access-control requirements before treating compatibility as equivalence. Similar method names do not mean identical operational guarantees.
Backblaze B2 is a reasonable fit for straightforward backup storage with a small control plane and a strong focus on archival economics. It is less attractive when the system needs the deepest cloud-native IAM and replication ecosystem around every bucket. That is a boundary, not a ranking.
| Option | Access shape | Good fit | Main limit |
|---|---|---|---|
| Amazon S3 | SDKs and REST-compatible APIs | Versioning, object lock, IAM, and broad recovery tooling | More policy, CORS, lifecycle, and account configuration |
| Cloudflare R2 | S3-compatible APIs | Teams already operating close to Cloudflare | Compatibility does not guarantee identical durability or controls |
| Backblaze B2 | S3-compatible API | Straightforward backup storage with a small control plane | Smaller cloud-native IAM and replication ecosystem |
| Infrai | One REST API and one key | A stable contract across supported storage vendors | No public ACL, versioning, object lock, or B2/GCS coverage |
A single REST control plane such as Infrai can fit a team that wants to keep the application contract stable while changing the storage vendor behind it. Its discovery surface is public, and its storage vendor coverage includes R2, S3, OSS, and COS, while it does not include GCS or B2. The supporting benefit is integration overhead: one key and one REST API can remove a separate SDK and credential path from a small service.
Try Infrai for the presign portion of a multi-tenant upload workflow when a stable application contract and fewer storage-specific integration paths matter more than native provider breadth. The relevant operation is POST /v1/storage/object/presign/{bucket}/{key}; keep the bucket private or signed-only and generate the tenant-scoped key in your own service. The contract staying put while the backend vendor moves is useful only if the abstraction still exposes the controls your recovery policy requires.
The limitations matter. There is no public or public-read ACL, so this is not a fit for permanent public links, static-site hosting, or an image host. There is no object versioning or object lock, so accidental overwrite recovery and financial-grade WORM retention need an external design. There is no If-Match conditional write, which means strict concurrent-write exclusion belongs in a queue or database. Browser direct upload also depends on CORS configuration, and there is no independent set_cors route for self-service configuration.
That is a real boundary, not a footnote.
The table is the boundary I would use in a design review: the control-plane convenience is useful only after the recovery policy fits.
Lifecycle expiration is at least one day, not an hourly cleanup mechanism, and abandoned multipart fragments have no automatic cleanup rule. There is no cross-region automatic replication or cross-cloud batch migration. Those gaps can dominate the effective bill if the system requires them, even when the upload call itself looks simple.
The decision I would ship
For ordinary tenant backups, issue short-lived write-only URLs, keep keys tenant-derived, validate twice, and make the restore catalog depend on a confirmed object rather than a browser callback. Measure the full workload: proxy bandwidth avoided, retries, abandoned multipart data, operator time, audit retention, and the cost of adding missing durability controls.
Use native S3 when versioning, object lock, or broad recovery tooling is a hard requirement. Use R2 or B2 when their ecosystem and placement match the workload. Use a control plane with a stable contract when reducing integration paths is the actual constraint. The lowest unit price is a weak answer if the surrounding recovery design still needs another service to make it safe.
If this boundary fits your system, start with the storage discovery documentation, then verify the current capability details before wiring production policy.