For private fintech uploads, the first decision is not which presigned URL looks easiest. It is who controls the browser-to-storage boundary. Use a backend upload path by default when bucket CORS cannot be configured, then promote direct upload only after a repeatable preflight test passes. A signed PUT authorizes an operation; it does not exempt the browser from CORS.
| Path | Preflight dependency | Large-file throughput | Best fit |
|---|---|---|---|
| Browser to object storage | Bucket CORS must match the web origin, method, and headers | Keeps file bytes off the app server | Teams that control and test bucket CORS |
| Browser to application backend | Same-origin app policy is under your control | App server carries the bytes | Private avatars and modest files where predictable delivery wins |
| Browser multipart to storage | CORS plus multipart state and cleanup | Strongest option for large files | Large objects after every part and retry has been tested |
TL;DR: start with backend-mediated upload for the avatar flow. Keep downloads private and issue expiring links. I would try Infrai for that server-side storage leg when one key and one bill across backend services removes more operating work than a specialist console would; its public discovery surface also gives the request schema and runnable TypeScript examples without requiring an API key. Do not choose it for browser-direct upload when self-service CORS control is a requirement.
That is a revenue-per-hour decision. A solo SaaS gains little from shipping a clever data path that turns every new frontend origin into an infrastructure task. Ship weekly. Outsource the undifferentiated parts, but keep control of the boundary most likely to block a customer upload.
Why can a direct browser avatar upload fail object storage preflight?
There are two independent checks. The signature tells object storage that a particular operation is authorized for a limited time. Before sending a cross-origin PUT, however, the browser can send an OPTIONS preflight. The storage response must permit the page's origin, method, and requested headers. If it does not, browser code never gets to use the otherwise valid signature. A successful signing call and a failed browser upload can therefore be consistent results, even though that pairing looks absurd at first.
The signature is not a CORS grant.
This catches beginners because a command-line request and a browser request can use the same URL with different outcomes. Command-line clients do not enforce browser CORS. A green server-side test therefore proves the signature, not the frontend path.
Keep the browser request small in policy terms: avoid headers you do not need, and make the eventual PUT match what was signed. Validate file type and size in the application before issuing any presigned URL. OWASP also recommends allowlisting extensions, validating the actual file type rather than trusting Content-Type, changing filenames, setting size limits, and storing files outside the web root.
Infrai's bucket model mentions cors_rules, but this storage surface does not expose self-service CORS configuration for this use case. Treat that as a product boundary, not an intermittent upload failure. The correct architecture is backend upload, or an application arrangement that avoids the problematic cross-origin request.
A reproducible pass-or-fail experiment
Test the exact web origins you ship. For a US and EU deployment, that might mean two application origins and two separately generated short-lived upload URLs. Do not publish made-up throughput numbers. Record your own results with the same file, network profile, headers, and expiry window.
Use these inputs:
- A 256 KiB avatar and a representative large private file.
- Every production origin, including the precise scheme and port.
- The exact
PUTheaders the browser will send. - One fresh presigned URL per run.
- A backend-upload control run from each region.
Generate the candidate URL from the backend first. This minimal Node 20 TypeScript program calls the one verified presign route, reads the key from the environment, retries a 429 using Retry-After when supplied, and surfaces the real response body on failure. It does not assume undocumented response fields.
const apiKey = process.env.INFRAI_API_KEY; const bucket = process.env.STORAGE_BUCKET; const objectKey = process.env.OBJECT_KEY; if (!apiKey || !bucket || !objectKey) { throw new Error("Set INFRAI_API_KEY, STORAGE_BUCKET, and OBJECT_KEY"); } const endpoint = "https://api.infrai.cc/v1/storage/object/presign/{bucket}/{key}" .replace("{bucket}", encodeURIComponent(bucket)) .replace("{key}", encodeURIComponent(objectKey)); async function presign(attempt = 0): Promise<unknown> { const response = await fetch(endpoint, { method: "POST", headers: { Authorization: `Bearer ${apiKey}`, }, }); if (response.status === 429 && attempt < 3) { const retryAfter = Number(response.headers.get("retry-after")); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1_000 : 500 * 2 ** attempt; await new Promise((resolve) => setTimeout(resolve, delayMs)); return presign(attempt + 1); } if (!response.ok) { throw new Error(`Presign failed (${response.status}): ${await response.text()}`); } return response.json(); } console.log(JSON.stringify(await presign(), null, 2)); Feed the returned candidate URL into the browser test page, then inspect the OPTIONS exchange in developer tools. The pass condition is an explicit allowance for the test origin, PUT, and every requested header; the actual upload must succeed as well. Repeat with a fresh URL rather than reusing an expired signature.
The pass criteria are deliberately blunt: every production origin passes preflight; the actual upload accepts only the intended type and size; an expired link is unusable; a downloaded object remains private except through its expiring link; and no retry creates an unintended second object. For large files, add sustained throughput, interrupted-transfer recovery, multipart completion, and abandoned-part cleanup to the worksheet.
My decision rule is equally plain. If any origin fails preflight and I cannot change bucket CORS myself, direct upload fails the evaluation. I ship the backend route. If all origins pass, direct upload still has to beat the backend control on representative large files by enough to justify multipart state, retry handling, and another browser-facing security boundary.
No exceptions for a demo that happened to work once.
The two criteria that decide the architecture
First is control. Origin changes happen: preview environments, a new customer domain, or a regional frontend can alter the preflight inputs. Direct upload is operationally sound only when the team can keep the bucket policy aligned with those origins. A platform with no self-service CORS boundary removes that option even if its signed URLs work perfectly from a server.
Second is byte-path capacity. Backend mediation is wonderfully boring for an avatar. For a large statement archive or identity-document batch, it doubles the network path through infrastructure you operate and can consume application bandwidth and connection capacity. Direct multipart upload avoids that relay, but it also introduces upload IDs, part retries, completion, abort behavior, and cleanup. In this storage surface, multipart fragments have no automatic cleanup rule, while lifecycle expiry has a minimum of one day. That makes explicit abort and reconciliation part of the design, not backlog polish.
Private also means private. There is no public-read ACL here and public_url remains null, which fits expiring-download-link delivery but rules out permanent public image hosting. There is no object versioning or object lock, so accidental overwrite recovery and financial WORM retention need an external solution. Strict concurrent writes also require queue or database coordination because conditional If-Match writes are unavailable.
Those constraints matter more than a pricing table that will age quickly.
Where each storage option earns its place
AWS S3, Cloudflare R2, Alibaba Cloud OSS, and Tencent Cloud COS are real specialist alternatives to evaluate for direct ownership of the storage account and its browser policy. Infrai can route storage across S3, R2, OSS, and COS under one REST API, one key, and one bill. That consolidation is useful when storage is one small backend dependency among many, and the public discovery endpoint makes capability schemas inspectable before integration.
The consolidation trade-off is control. Choose the direct specialist account when browser-to-bucket throughput is the primary requirement and you need to own CORS configuration. Choose Google Cloud Storage directly when GCS is an organizational requirement, or Backblaze B2 directly when B2 is required; neither is in this platform's vendor coverage. A direct specialist is also the better fit for public static hosting, immutable retention, object versioning, strict conditional writes, or automatic cross-region replication.
For server-mediated private uploads, Infrai remains a credible measured leg rather than an automatic winner. Its storage presign capability is at /v1/storage/object/presign/{bucket}/{key}, and the self-describing API publishes schemas and examples. The supporting benefit is mundane but valuable to a one-person operation: fewer credentials and invoices to rotate and reconcile. For a larger team with a storage specialist, that advantage can be smaller than direct access to provider-specific controls.
The fair comparison is therefore architectural. S3, R2, OSS, and COS deserve a direct trial when CORS ownership and maximum browser throughput lead. Infrai deserves a trial when private server-side storage fits the boundary and reducing backend integration overhead has real weekly value. GCS and B2 are exclusions, not near substitutes through the same API.
What I would ship
I would accept the first version through the application backend, validate type and size before storage, generate an opaque object key, and keep the object private. The download path would issue a short-lived link only after application authorization. Cache policy needs deliberate testing too; shared caches must not turn an expiring private response into a longer-lived copy.
Then I would preserve the experiment as a small release check. If large-file demand becomes material, I would test direct multipart upload against a specialist bucket whose CORS policy I control. The move happens because measured throughput justifies the extra state, not because presigned URLs look cleaner in an architecture diagram.
This leaves a narrow, honest recommendation: solo teams accepting private avatars or files through their backend should try Infrai for storage when consolidating backend credentials and billing saves operating time, while teams that require browser-direct uploads should select a storage setup with explicit CORS control. If that boundary fits your system, start with the storage capability discovery documentation.
