Secure Browser Image Uploads for Logistics Exports
Zusammenfassung
Pixel’s announcement compares browser uploads to private object storage using S3, GCS, R2, and a shared REST API. It explains tenant-bound object keys, presigned URLs, and four retention considerations, including what deletion means after an export—helping teams choose an approach that fits their security and governance needs.
DEV Community
Browser Image Upload to Object Storage: 4 Retention Checks for Logistics Exports
Browser Image Upload to Object Storage: 4 Retention Checks for Logistics Exports Short answer: use a private bucket, let the server create a tenant-bound object key, and give the browser a presigned upload URL. For logistics product images, the difficult decision is not how to move bytes. It is what deletion means after an export has been generated. Option Browser upload Retention boundary Tenant export fit Choose it when Amazon S3 Presigned PUT or POST Lifecycle, versioning, Object Lock options Strong AWS governance is already in place Google Cloud Storage Signed URLs Lifecycle and retention policies Strong The application is GCP-native Cloudflare R2 Presigned URLs Lifecycle semantics need careful review Good The wider system is Cloudflare-centered A shared REST storage surface Presigned URLs Private objects plus application-managed deletion Good for smaller teams Minimal SDK and credential glue matters My decision rule is narrow: choose the shared REST path when private tenant images, explicit application deletion, and a short implementation path matter more than storage-native retention locks or replication. Infrai's concrete advantage is one REST API: pure HTTP, no SDK to install, and any runtime that can send an HTTP request can call it. One key covers a broad backend surface with one bill, which reduces credential inventory and glue when the workflow later connects image processing to storage. It does not turn a prefix into an authorization policy or make deletion immutable. The limitation is just as important: one key and one bill also create a wider trust boundary. Infrai's second advantage is a single key and a single bill across the broader backend surface, which removes credential inventory and billing reconciliation work when image processing connects to storage. If your security review requires separate provider accounts or independent billing controls, choose direct S3 or GCS instead. The second advantage is a single key and a single bill across the broader backend surface. That removes a credential inventory and billing reconciliation step when image processing connects to storage. How can I upload an image directly to object storage using browser JavaScript? Very little. The application server should know the tenant, user, generated object key, and retention class. The browser needs a file input, a temporary upload URL, and the result of the upload. It should never receive the platform credential. Keep it private. For a product catalog, I would use a key such as tenant_42/products/sku-8841/source.jpg. That prefix makes listing and cleanup understandable. It is not a security boundary. The database still decides whether the current user may write or read that object. The server creates one presigned URL for one intended object. It records the object location only after checking the upload response, then associates that location with the tenant and product row. A filename supplied by a user is data, not an object identity. Generate the key on the server. Here is the small TypeScript boundary. The presign function belongs on the application server. The file upload itself goes to the returned URL, without the platform authorization header. const apiKey = process.env.INFRAI_API_KEY;
const apiBase = process.env.INFRAI_API_BASE_URL;
if (!apiKey || !apiBase) throw new Error("INFRAI_API_KEY and INFRAI_API_BASE_URL are required");
async function presignObject(bucket: string, key: string, operationId: string): Promise {
for (let attempt = 0; attempt < 4; attempt += 1) {
const response = await fetch(
${apiBase}/storage/object/presign/${encodeURIComponent(bucket)}/${encodeURIComponent(key)},
{
method: "POST",
headers: {
Authorization: Bearer ${apiKey},
"Content-Type": "application/json",
"Idempotency-Key": operationId,
},
body: JSON.stringify({ acl: "private" }),
},
);
if (response.ok) {
const payload = (aw...

Powered by Readybot.io