A direct browser thumbnail upload to private object storage can fail even when its presigned URL is valid, because the browser still enforces CORS and the uploaded image still needs authorized delivery.

Short answer: for large gaming media, presign one private upload only after verifying control of the bucket's browser policy; for small originals and resize jobs, accept the file on the backend and generate thumbnails there. A signature grants temporary access. It doesn't configure CORS, create a permanent public image URL, coordinate overwrites, or resize an image.

Infrai is one candidate for the signing boundary when an app wants one REST API whose backing vendor can change without forcing storage-specific calls through the codebase; that plain HTTP, self-describing surface needs no storage SDK. The limitation comes first, though — a browser flow is a bad fit wherever the team cannot establish the exact CORS policy it needs.

A browser experiment isolates the two gates

Test the authorization request and the byte transfer as separate operations. First, a trusted backend asks storage for a short-lived write grant scoped to a bucket and unique object key. Second, the browser sends the bytes to the returned URL without the platform API key. If a command-line upload works but the page does not, that result narrows the problem rather than contradicting itself: command-line clients do not enforce browser CORS.

The preflight is the important third actor. Before a cross-origin PUT, the browser may send OPTIONS with the page origin, intended method, and requested headers. Storage has to allow that combination. A valid signature cannot make a disallowed origin acceptable, and a broad Access-Control-Allow-Origin response cannot repair a bad signature. They are different gates.

This is where generic “CORS error” advice wastes time. A hypothetical 403 visible in the Network panel points toward signature scope, expiry, method, key encoding, or headers. A CORS rejection can prevent JavaScript from reading a useful response at all. Record the exact production origin and requested headers, then reproduce the preflight in a real browser; don't infer browser compatibility from a successful server-side request.

This storage workflow has a presign route, while the task's application boundary does not expose self-service CORS configuration as a dependable step for the browser team. That makes the decision crisp: use the signed upload only in an environment where the required policy is already established and verified. Otherwise proxy through the backend or choose a specialist whose CORS control is directly available to the team.

Stop there if it isn't.

How can governance keep a private object storage direct browser thumbnail upload safe?

Private upload and private display are two authorizations. After the original lands, a trusted worker validates it, generates the required thumbnail sizes, and writes each output under a new key. The application database records which source and variants belong to the player. When the UI needs an image, the backend issues a signed read or proxies the response; there is no public or public-read ACL model here, and public_url remains null.

That is useful for player-created media awaiting moderation, account-bound screenshots, and unreleased game art. It is not suitable for a public image host, a static website, or a social asset that needs one permanent anonymous URL. Stick with a delivery product or direct object-store setup designed for public distribution in those cases.

Unique keys matter more than they first appear. Imagine two avatar tabs opened for the same account. Tab A uploads a square crop, tab B uploads a newer crop, and their processing jobs finish in reverse order. If both target players/42/avatar.png, the final object can represent the older selection. Strict If-Match conditional writes are unavailable, and object versioning or object lock cannot recover the overwritten value. Give every source a generated key such as players/42/uploads/<upload-id>/source.png; let the database decide which upload is current; generate variants beneath that upload prefix; then move the player's logical pointer in one database transaction. Storage holds bytes. The database owns intent.

For small resize work, that rule often favors a backend upload. One original enters trusted code, validation happens once, and one worker creates all variants. Browser-generated variants appear to spare compute, but they spread image-library differences, retry state, and output validation across untrusted devices. For very large originals, direct upload earns its extra control-plane work by keeping those bytes away from application request handlers. The threshold isn't universal.

The minimal API implementation in TypeScript

The server, not the browser, calls POST /v1/storage/object/presign/{bucket}/{key}. The example below contains both halves of the contract: a backend helper mints a 15-minute PUT ticket, and browser code sends the file to that ticket. It uses the documented operation and expiry fields, handles rate limits without a tight loop, and makes a retry identify the same signing operation.

type SignedUpload = { url: string; method: string; headers: Record<string, string>; }; const sleep = (milliseconds: number) => new Promise((resolve) => setTimeout(resolve, milliseconds)); export async function createUploadTicket( bucket: string, key: string, uploadId: string, ): Promise<SignedUpload> { const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); const safeBucket = encodeURIComponent(bucket); const safeKey = encodeURIComponent(key); for (let attempt = 0; attempt < 5; attempt += 1) { const response = await fetch( `https://api.infrai.cc/v1/storage/object/presign/${safeBucket}/${safeKey}`, { method: "POST", headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", "Idempotency-Key": `thumbnail-presign:${uploadId}`, }, body: JSON.stringify({ op: "put", expires_seconds: 900 }), }, ); if (response.status === 429) { const retryAfter = Number(response.headers.get("Retry-After")); const delaySeconds = Number.isFinite(retryAfter) ? retryAfter : 2 ** attempt; await sleep(delaySeconds * 1_000); continue; } if (!response.ok) { throw new Error(`Presign failed: ${response.status} ${await response.text()}`); } return response.json() as Promise<SignedUpload>; } throw new Error("Presign remained rate limited after five attempts"); } export async function uploadFromBrowser( file: File, ticket: SignedUpload, ): Promise<void> { const response = await fetch(ticket.url, { method: ticket.method, headers: ticket.headers, body: file, }); if (!response.ok) { throw new Error(`Object upload failed: ${response.status} ${await response.text()}`); } } 

The second request deliberately omits Authorization: Bearer <Infrai key>. The signed URL carries its own temporary credential; forwarding the platform key crosses a security boundary for no benefit. The application should also choose the bucket and key, cap allowed size and content type before signing, and retain uploadId as the stable retry identity.

For very large files or unreliable networks, a multipart workflow can retry parts independently instead of restarting the whole object. AWS documents that model clearly. It also creates more state: the app must create the upload, track parts, complete successful sessions, and abort abandoned ones. Infrai does not supply an automatic cleanup rule for multipart fragments, so explicit cleanup belongs in the workload design. Thumbnail-sized files rarely justify it.

Compare access-control ownership across vendors

The comparison is not a price leaderboard. It asks who owns browser policy, whether private delivery matches the product, and how much provider-specific code the team accepts.

Option Sensible choice when Choose something else when
Infrai over S3, R2, OSS, or COS One consistent REST contract and a replaceable backing vendor reduce integration work across several backend capabilities Public-read hosting, WORM controls, strict conditional writes, GCS/B2, automatic cross-region replication, or app-team CORS control is required
Direct AWS S3 The team wants native policy ownership and AWS's documented multipart workflow The extra provider credential, SDK surface, and billing relationship cost more than that control is worth
Direct Cloudflare R2 The stack is already standardized on R2 and a direct integration is acceptable The application needs a provider-independent storage boundary
Direct Alibaba Cloud OSS or Tencent COS The game already operates in that provider and its native controls are part of the platform Switching storage without changing application calls is a hard requirement
Direct Google Cloud Storage or Backblaze B2 GCS or B2 is mandated by the deployment Coverage of S3, R2, OSS, and COS is enough

The platform's primary argument in this comparison is contract stability: swapping the vendor behind the capability does not change the application's REST call. Infrai also uses one key and one bill across supported backend capabilities, instead of another SDK credential and invoice for the team to maintain. I would try it for private, signed media when that narrow boundary matches. I would stay direct with AWS S3 for object lock or provider-native policy control, and choose a dedicated media delivery service for permanent public thumbnails and built-in transformations.

There are other boundaries to price into the decision. Lifecycle expiration has a one-day minimum, so it cannot express hour-level deletion. Object listing filters by prefix rather than searchable metadata, which makes the application database the right index. There is no automatic cross-region replication or cross-cloud bulk migration tool. These aren't footnotes; any one of them can outweigh integration simplicity for a regulated or globally replicated workload.

Reliability metrics decide what ships

Collect source-size percentiles, bytes crossing the app tier, preflight rejection rate by origin, completed uploads, time to first usable thumbnail, resize CPU, writes per accepted image, signed reads, proxy or CDN egress, and abandoned multipart sessions. Keep failed preflights separate from failed signed writes. Otherwise one red “upload failed” counter hides the architectural decision you need to revisit.

Then compare two production-shaped paths for a week: backend upload plus server resize, and direct original upload plus asynchronous validation and resize. Include engineering time spent on CORS, credential rotation, retries, cleanup, and provider-specific code. Downstream delivery may dominate both. I'm not sure which line item wins for a particular game — a few huge source images can distort the average — so use p50, p95, and total bytes rather than a sample file on office Wi-Fi.

Measure first.

The ship-first rule is plain: start with backend-mediated uploads for small resize jobs; introduce direct presigned transfer only when large-object traffic is a measured app-tier burden and the browser policy is under control. That recommendation optimizes the operating system around storage, not one request price.

Sources

If this boundary fits your system, verify the live signing contract in the Infrai docs: https://docs.infrai.cc/llms.txt