Reliable Browser Uploads for Logistics Reports
Resumo
Pixel’s announcement explains how to upload logistics reports directly from browsers to object storage using presigned PUT or multipart workflows. It covers resumable uploads, application-owned report state, validation, private access, and scheduled cleanup—key safeguards for reliable customer-facing report handling.
DEV Community
Logistics Report Retention: Browser-to-Object Storage with Presigned Uploads
Short answer: for a logistics report that must survive an ordinary customer connection, use a presigned PUT for a small object and a presigned multipart workflow for a large one; use POST when a form policy is the requirement. The more important decision is retention: keep an upload private and addressable until the report is authenticated and validated, then delete it on a recorded schedule rather than treating a successful upload as the end of the job. That answer fits the way I build Python RAG and agent features. The browser should move bytes directly to object storage. The Python service should authorize the upload, write a durable report record, evaluate the completed object, and issue a short-lived download URL. Keeping the report bytes out of the API process makes the notebook-to-prod path smaller, but it also makes ownership explicit: the browser owns transfer, the application owns report state, and storage owns object bytes. A report is not ready just because a request returned 200. The awkward case is a dispatcher who uploads a generated route report from a hotel network, closes the laptop when the progress bar reaches 68 percent, and opens the customer portal again the next morning. The portal must not create a second report record just because the browser lost its local state. It should find the existing uploading record, see whether its presigned capability is still valid, and either resume the known parts or issue a new plan for the same application-owned report. If the retention deadline passed overnight, resuming is the wrong action: mark the attempt expired, abort or remove its temporary storage state, and ask the user to generate a fresh report. That decision belongs to the report state machine, not to whichever callback happened to run last in the browser. In an eval harness, I would assert that the old object cannot become customer-visible after the replacement plan completes, that a duplicate completion cannot extend retention silently, and that the cleanup worker has enough identifiers to remove both the abandoned attempt and any rejected final object. This is where a direct upload stops being a file-transfer trick and becomes part of an authenticated customer workflow. Keep that boundary visible. What should a browser upload workflow do with large logistics reports? Start with one application record per report. Give it a non-guessable object key, the customer identity, the expected byte count, a content type, a retention deadline, and a state such as created, uploading, uploaded, validated, or deleted. The backend returns an upload plan only after it has authenticated the customer and checked that the requested report belongs to that customer. The browser uploads directly, then tells the backend which report it attempted. A worker verifies the object before it enters parsing, chunking, embedding, or retrieval evaluation. This order prevents a common logistics failure: a customer can see a progress bar for a report that the AI pipeline has never accepted. It also gives deletion a subject. A lifecycle rule can remove old bytes, but the application still needs to know whether it is deleting an abandoned upload, an invalid report, or a report whose customer-visible retention period has ended. Those are different audit events. For a small report, a single presigned PUT is usually the easiest contract. There is one request, one progress stream, and one whole-object retry. For a large report, multipart upload changes the unit of recovery from the whole object to a part. If part 8 fails, the browser can retry part 8 instead of sending parts 1 through 7 again. Presigned POST is a different shape. It gives the browser a form submission plus policy conditions, which can be useful when the storage integration already standardizes on form fields and constrained keys. It is not a universal upgrade over PUT. Choose it because its policy model fits the application, not because the word “presigned” makes it more res...

Powered by Readybot.io