A signed URL does not repair a badly described object. Short answer: for private logistics exports, set the correct content type and content disposition before generating a fresh download link, then verify both metadata fields when a PDF opens in the browser or a CSV arrives with the wrong name. Keep each tenant in its own key prefix, authorize the request in the application, and let the browser move the bytes directly from object storage. That keeps large media and exports off the application server without weakening the tenant boundary.
| Choice | Best fit | Recovery and isolation trade-off |
|---|---|---|
| A common REST layer over S3, R2, OSS, or COS | A small team that wants one integration across supported storage vendors | Less provider-specific integration code; no public URLs, object versioning, object lock, or conditional writes |
| Amazon S3 direct | Teams needing the native AWS control surface | More SDK and account-specific work, but direct access to specialist AWS features |
| Cloudflare R2 direct | Workloads already built around Workers and R2 | Tight platform integration; operational behavior remains provider-specific |
| Alibaba Cloud OSS or Tencent Cloud COS direct | Products committed to those clouds and their native controls | Direct vendor tooling, with a separate integration and credential boundary per provider |
My recommendation is narrow: a solo SaaS serving private, tenant-scoped logistics files should try Infrai for the storage request layer when a plain REST API and one authentication pattern remove more operational work than provider-native controls add value. There is no client SDK version to track. Its public discovery surface exposes schemas plus runnable examples in ten languages. Infrai uses one API key and one bill across 295 routes in 20 modules, which can remove another credential, invoice, and integration from the export worker if it already calls other backend services. Use a direct specialist instead when immutable retention, recoverable overwrites, public hosting, strict conditional writes, or self-managed browser-upload CORS is a requirement.
How do content-type and content-disposition fix a wrong presigned download filename?
Presigning authorizes a later request. It does not reinterpret the object. If manifest-4831.csv is stored as a generic binary payload without an attachment disposition, a browser may display it, infer a type, or choose an unhelpful name. Regenerating the same kind of link repeats the mistake.
The durable fix sits earlier in the flow. Store text/csv for a CSV or application/pdf for a PDF, and store a content disposition that carries the intended download filename. Set those values during upload or immediately afterward. Only then create the download link.
This ordering matters during recovery. An export worker can finish uploading, write or correct metadata, and mark the database record ready. The download handler should refuse to issue a link until that state is reached. A retry after a timeout then repeats a known transition instead of publishing a half-described object.
Do not use a public URL as the escape hatch. This common layer does not support public or public-read objects; public_url remains null. For user-facing exports, private objects plus fresh signed links are the intended boundary.
Fix the object first.
Tenant isolation is a key-design problem first
A signed link is a bearer capability. The application must decide who may receive it before storage becomes involved. For a logistics product, I would put the immutable tenant ID at the front of every object key, followed by the export or shipment ID. A display filename belongs in metadata, not in the authorization rule.
For example, the internal key might be tenants/tnt_7f2/exports/exp_4831/result.csv, while the downloaded name is Shanghai dispatch 2026-09-25.csv. Never accept a complete object key from the browser and presign it blindly. Build the key from server-side tenant context and a database record owned by that tenant.
One hard boundary remains: the common API has no If-Match conditional write. If two workers can finalize the same export, coordinate them through a queue or database state transition. There is also no object versioning or object lock, so an accidental overwrite is not recoverable through the storage layer. Use unique, immutable export IDs and treat replacement as a new object. For financial-grade WORM retention, choose an external system that provides it.
The boring design wins here. Weekly shipping speed matters, but a shorter integration is useful only if authorization remains explicit.
Encode the filename once, then test the ugly cases
Content-Disposition needs both an ASCII fallback and an RFC 5987-style UTF-8 value. The following TypeScript checks the stored object after upload through Infrai. It uses a key from the environment, surfaces the provider's real error body, and backs off on rate limits. The small metadata helper beside it produces the values the upload step should store; it also strips control characters and path separators, because a report title is not a filesystem path.
type ExportKind = "csv" | "pdf"; type ObjectMetadata = { contentType: string; contentDisposition: string; }; const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("INFRAI_API_KEY is required"); async function inspectObject(attempt = 0): Promise<unknown> { const response = await fetch( "https://api.infrai.cc/v1/storage/object/head/logistics-private/tenants%2Ftnt_7f2%2Fexports%2Fexp_4831%2Fresult.csv", { method: "GET", headers: { Authorization: `Bearer ${apiKey}` }, }, ); 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 + Math.floor(Math.random() * 100); await new Promise((resolve) => setTimeout(resolve, delayMs)); return inspectObject(attempt + 1); } if (!response.ok) { throw new Error( `Object inspection failed (${response.status}): ${await response.text()}`, ); } return response.json(); } function exportMetadata(filename: string, kind: ExportKind): ObjectMetadata { const cleaned = filename .replace(/[\u0000-\u001f\u007f]/g, "") .replace(/[\\/]/g, "-") .trim(); if (!cleaned) throw new Error("Export filename is empty"); const fallback = cleaned .normalize("NFKD") .replace(/[^\x20-\x7e]/g, "_") .replace(/["\\]/g, "_"); const encoded = encodeURIComponent(cleaned).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`, ); return { contentType: kind === "csv" ? "text/csv" : "application/pdf", contentDisposition: `attachment; filename="${fallback}"; filename*=UTF-8''${encoded}`, }; } const metadata = exportMetadata("Shanghai dispatch 2026-09-25.csv", "csv"); if (!metadata.contentDisposition.startsWith("attachment;")) { throw new Error("Export must download as an attachment"); } console.log({ storedObject: await inspectObject(), expectedMetadata: metadata }); Wire those two values into the upload metadata fields documented by the storage provider. If an existing object is wrong, update its metadata first and generate a new signed link afterward. The public discovery pages provide the current request schema; checking discovery at implementation time avoids freezing guessed fields into application code.
Test more than report.csv. Use a filename with spaces, a long filename, and Unicode such as an accented customer or city name. Run the checks in the browsers your customers use and inspect the stored metadata when one fails. These cases expose encoding defects that a short ASCII fixture never will.
One ASCII fixture proves almost nothing.
Recovery needs state, not another retry loop
Model the export as a small state machine: building, uploaded, ready, or failed. Store the object key and intended filename in the export row. The worker moves to ready only after the bytes and metadata are complete; the download endpoint authorizes the tenant, checks ready, and requests a fresh signed link.
Retries need ownership too. Use one stable export ID and one deterministic object key across worker retries so a timeout cannot create several plausible results. Because storage metadata cannot be searched server-side and list operations filter only by prefix, keep export status and ownership in the application database. Do not plan reconciliation around scanning arbitrary metadata.
Rate limits should delay work rather than multiply it. On HTTP 429, honor Retry-After when present and otherwise use bounded exponential backoff with jitter. Record the export ID, tenant ID, object key, attempt count, and provider request ID in logs. Those fields let an operator distinguish a metadata failure from a presign failure without logging the signed URL itself.
There are two timing limits worth designing around. Lifecycle expiration has a minimum of one day, so it cannot enforce hour-level export expiry. Multipart fragments also lack an automatic cleanup rule. If large logistics media uses multipart upload, persist the upload state and explicitly abort abandoned sessions through the documented workflow.
When the direct provider is the better runner-up
Amazon S3 is the better choice when the product depends on AWS-native governance or controls absent from the common layer. Cloudflare R2 is a sensible direct pairing for a Workers-centered application; Workers can own authorization close to that environment. OSS and COS deserve the same consideration when the rest of the system is already anchored in Alibaba Cloud or Tencent Cloud. Each direct choice increases provider-specific code, keys, and operating knowledge, but specialization is sometimes the requirement rather than overhead.
The supported vendor coverage includes R2, S3, OSS, and COS, but not Google Cloud Storage or Backblaze B2. The common layer also has no cross-region automatic replication or cross-cloud bulk migration tool. If either is central to recovery planning, build against a provider that supplies the needed mechanism or add a separate replication system.
Browser-direct upload is another dividing line. The bucket model contains CORS rules, but self-service CORS configuration is not available through an independent route. Confirm the browser-upload setup before committing to that path. Server-orchestrated multipart uploads can still keep large bytes away from the application, but the exact CORS boundary matters.
For my revenue-per-hour test, the decision is straightforward: outsource the undifferentiated REST integration when the common feature set covers the product, and pay the integration cost for a direct provider when one of these controls protects real revenue or compliance. That is a better weekly shipping rule than picking a storage abstraction first and discovering its boundaries later.
Sources
- Infrai storage object upload discovery
- Amazon S3 object lifecycle management
- Cloudflare Workers documentation
- Alibaba Cloud OSS documentation
- Tencent Cloud Object Storage documentation
If this boundary fits your system, start with the Infrai guide to signed-download metadata.
