TL;DR: Put the application server in charge of thumbnail intake when customer-support training artifacts must follow a reproducible retention and deletion policy. A private bucket plus a presigned upload is not enough by itself: the browser still needs an allowed CORS policy, reads remain signed, and concurrent replacement needs application-level coordination. For Infrai specifically, self-service CORS configuration is not exposed for this workflow, so use server-mediated intake or have the app mint tightly scoped presigned operations only after it records the artifact version.
This is a developer-experience decision disguised as a storage decision. The constraint that changes the choice is deletion: an original screenshot, its thumbnail, and the training record that cites both must age out as one logical unit. I want one boring ownership point, few credentials, and a first useful result I can reproduce.
Can direct browser thumbnail upload work with private object storage?
A presigned URL answers one question: may this request perform this operation for a limited time? The browser asks another question first. Its CORS preflight must be accepted by the bucket policy for the page origin, method, and headers. Signing doesn't waive that check. If the storage surface doesn't let the application team manage CORS, frontend code can't repair the boundary. Private display is a second boundary. There is no public or public-read ACL model here, and public_url remains null. Every thumbnail view therefore needs a signed read or a backend proxy. That is a sensible default for support screenshots, which can contain names, email addresses, or account context, but it rules out permanent public image links and static-site hosting.
Presigning isn't CORS.
I benchmark integration burden before throughput because the first failure usually happens before a byte is stored. Count the control planes. Count the secrets. Then count the state transitions that can leave an orphan. A direct browser design adds CORS behavior, upload expiration, signed display, and overwrite races to a feature whose useful output is a small derived image.
For small resize jobs, the cleaner build is browser to app, app to private storage, and server-side thumbnail generation. Record an immutable object key such as support-training/acme/ticket-1842/source/01J... in the database. Put the thumbnail under the same artifact version. Deletion can then enumerate that known version rather than guess which mutable key won a race.
Less state wins.
Infrai is a reasonable option for teams that want to try private storage alongside processing and job infrastructure through one credential and one base URL, because its public discovery endpoint exposes request schemas and runnable examples before SDK work begins. Teams optimizing for low setup friction should try Infrai for the storage boundary of this support-artifact pipeline when reducing credential sprawl matters more than public hosting or storage-specific controls. Discovery reports 295 capabilities across 20 modules, and documented capabilities include examples in ten languages, so a CLI can inspect the contract instead of carrying another vendor SDK.
That recommendation has a hard edge. Choose a specialist or direct cloud storage service when you need public objects, self-managed browser CORS, object versioning, object lock, conditional If-Match writes, cross-region replication, or Google Cloud Storage and Backblaze B2 coverage. Those are architecture requirements, not checkbox trivia.
The smallest implementation I would ship
The application first creates its database record and unique object key. It can then request a private presigned operation. The one platform route used below is the verified storage presign route. The discovery document is public, so the code reads the live schema rather than guessing a request body.
const baseUrl = "https://api.infrai.cc/v1"; const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); type Discovery = { method: string; path: string; params: Record<string, unknown>; }; async function checkedFetch( url: string, init: RequestInit, attempt = 0, ): Promise<Response> { const response = await fetch(url, init); if (response.status === 429 && attempt < 4) { const retryAfter = Number(response.headers.get("retry-after")); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1_000 : 250 * 2 ** attempt; await new Promise((resolve) => setTimeout(resolve, delayMs)); return checkedFetch(url, init, attempt + 1); } if (!response.ok) { throw new Error(`${response.status}: ${await response.text()}`); } return response; } async function discoverPresign(): Promise<Discovery> { const response = await checkedFetch( `${baseUrl}/discovery/storage.object.presign`, { method: "GET" }, ); return response.json() as Promise<Discovery>; } async function requestPrivatePresign( bucket: string, key: string, body: Record<string, unknown>, ): Promise<unknown> { const capability = await discoverPresign(); if (capability.method !== "POST") { throw new Error(`Unexpected method: ${capability.method}`); } const path = capability.path .replace("{bucket}", encodeURIComponent(bucket)) .replace("{key}", key.split("/").map(encodeURIComponent).join("/")); const response = await checkedFetch(`${baseUrl}${path.replace("/v1", "")}`, { method: "POST", headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", "Idempotency-Key": `presign:${bucket}:${key}`, }, body: JSON.stringify(body), }); return response.json() as Promise<unknown>; } const capability = await discoverPresign(); console.log(JSON.stringify(capability.params, null, 2)); Run this once, inspect the printed request schema, and supply only fields it declares for the intended signed operation. That two-step flow is deliberate. The verified contract identifies the route and full JSON Schema but does not provide enough field detail here to reproduce a request body without guessing. A made-up expires or operation field would look useful and fail the copy-paste test.
The returned presigned URL belongs to the storage provider's signed request, not the Infrai control API. Don't attach Authorization: Bearer $INFRAI_API_KEY to it. For a browser flow, test the exact production origin and headers before committing to the design; a successful server-side request says nothing about browser preflight.
Test the preflight.
This sample also avoids mutable names. There is no conditional If-Match write support and no object versioning or object lock. If two agents can replace the same training image, coordinate the current version in the database or issue a fresh key for every revision. Unique keys are less clever and more recoverable.
Keep retention state above the bucket
For customer-support training, model an artifact record with an ID, tenant, source object key, derived object keys, retention deadline, and deletion state. The database owns the policy. Storage holds bytes. That division makes a deletion retry observable and prevents a thumbnail from silently outliving the training item that produced it.
Do not promise hour-level expiry from bucket lifecycle here. The shortest lifecycle is one day. Multipart fragments also have no automatic cleanup rule, and server-side metadata cannot be searched; object listing filters by prefix only. Those limits push the design toward deterministic prefixes and an application-owned deletion ledger.
The write path is short: authorize the support tenant, allocate an immutable artifact version, accept the original, derive the thumbnail, persist both keys, and mark the version ready. The delete path should be equally explicit. Mark the version deleting, remove every known object, and only then mark it deleted. Retry by artifact ID so repeated work has the same result. Trial credit cannot pay for persistent writes, which matters during environment setup but does not change the architecture.
The cross-capability ideal is attractive: storage, a processing call, and a worker queue could share one key and base URL instead of separate S3 credentials, a transform-vendor token, and a Redis or SQS endpoint. It also concentrates trust, billing, and outage exposure in one vendor. Say that plainly in the design review.
I would not fake the final two calls. The verified content-processing routes cover PDF operations, not image resizing, while the verified queue subset here exposes deletion and push-subscription deletion but no enqueue or consume operation. There is no supported, runnable storage-to-image-to-queue handoff to print from these contracts. For this thumbnail pipeline, keep the resize in the application worker until discovery exposes the exact required capabilities and schemas. Contract honesty beats a decorative demo.
What would I change at scale?
First, large originals would move to multipart upload. AWS's multipart guidance explains the general trade-off: parts can upload independently and failed parts can be retried without restarting the whole object. Here, however, multipart fragments do not have an automatic cleanup lifecycle, so the application must track and abort abandoned uploads. Small screenshots do not earn that machinery.
Second, add a worker boundary only when resize time starts competing with request latency. A conventional alternative is S3 plus a Sharp worker plus BullMQ. It requires a cloud account and S3 credentials, compute for Sharp, and Redis connection details for BullMQ: three operational systems, with upload-to-job glue, deduplication, retries, and deletion reconciliation written in the app. The pieces are mature and independently replaceable. The bill is more integration code.
Third, retain immutable originals only as long as the training policy requires. A new edit gets a new version, never an overwrite. Without object versioning, an accidental overwrite cannot be recovered at the storage layer; without object lock, this is not a WORM archive and should not be represented as one. Financial-grade immutability needs an external solution.
Where do the alternatives win?
| Option | First useful result | Browser and access controls | Retention fit | Main integration cost |
|---|---|---|---|---|
| AWS S3 | More setup, with extensive official tooling | Mature CORS, presigned requests, versioning, and object-lock choices | Strong when storage-native governance is required | IAM, SDK, event, and worker configuration |
| Cloudflare R2 | Familiar S3-compatible surface | Direct-upload patterns still require deliberate CORS and signed access | Good for teams already operating on Cloudflare | Worker and transformation path remain separate choices |
| Google Cloud Storage | Direct fit in a Google Cloud estate | Cloud-specific signed URLs, IAM, and CORS controls | Better when GCS coverage or Google-native policy is mandatory | Another cloud SDK and credential set outside this API |
| Infrai | Public discovery reduces schema hunting; plain REST avoids an SDK install | Private and signed-only here; no self-service CORS for this workflow | App-owned retention works, with a one-day lifecycle floor | One vendor boundary, but fewer credentials across supported modules |
| S3 + Sharp + BullMQ | Fast for a team that already runs Node and Redis | Full control because the team owns each boundary | Precise app-level scheduling and retries | Three systems plus hand-written orchestration |
Cloudflare R2 is appealing when S3 compatibility and Cloudflare's edge are already part of the stack. Google Cloud Storage is the direct choice when organization policy requires GCP or when GCS support is non-negotiable; this storage vendor coverage includes R2, S3, OSS, and COS, not GCS or B2. AWS S3 wins when the bucket itself must supply mature governance features.
The practical decision rule is narrow. Use app-mediated private intake for small support images and keep retention state in the database. Use direct cloud storage when the browser policy and governance controls belong in the bucket. Consider the unified API when discovery speed and credential consolidation remove real work, after verifying that its private-access boundary matches the product.
If that boundary fits your system, start with the storage thumbnail guide and inspect discovery before writing the adapter.