{
  "id": 22622153,
  "title": "Document Intake: Presigned Browser Uploads Balance CORS Limits and Storage Retention",
  "url": "https://urgent.news/2026/11/29/document-intake-presigned-browser-uploads-balance-cors-limits-and",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-29T17:08:03.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/fletchervance3712/document-intake-presigned-browser-uploads-balance-cors-limits-and-storage-retention-5hkn"
  },
  "original_language": null,
  "account": "The best approach for uploading large course documents depends on the specific use case. Presigned browser uploads are ideal when dealing with large files and high application-server bandwidth costs. In contrast, server uploads are preferable when inspection of documents is required before they are stored. Regardless of the method, authorization, object naming, finalization, and expiring downloads should all be handled on the server-side.\n\nFor billing purposes, the cost is not a single figure but rather a combination of factors. A useful approximation is stored byte-months, uploaded requests, downloaded requests, delivered bytes, and application compute. For instance, a cohort of 10,000 learners submitting a 20MB document each would result in 200GB of storage for retained copies. If each document is downloaded three times, this adds an additional 600GB in delivery traffic, leaving 200GB of storage for the retention period. The dominant cost factor depends on reuse - long retention emphasizes byte-months, while repeated access emphasizes delivered bytes. This information should influence the architectural decisions made.\n\nThe easy setup is often seen as the optimal solution, but it has drawbacks. Ignoring abandoned objects, replacement submissions, download authorization, and reconciliation can lead to issues. The ideal production design consists of a control plane issuing narrowly scoped upload capabilities, a data plane carrying the bytes, and a finalization step that confirms the object's existence before the submission becomes visible. The foundation of this design is an immutable upload ID, which records the expected maximum size and media type and maps to an opaque object key (e.g., courses/{courseID}/submissions/{uploadID}). The database row serves as the business record, while the object functions as the payload. The user-supplied filename should be stored in metadata after validation and should not dictate the storage path or authorization rules.\n\nWhen planning, it is essential to model the scenario using variables rather than a fixed price that changes over time. The term model includes retained data (accepted bytes × retention time), upload traffic (attempted bytes, retry rate, abandoned uploads, relay versus direct path), delivery traffic (accepted bytes × authorized reads, reviewer count, repeat downloads, caching policy), request work (create, finalize, and read operations), and application work (bytes processed by the app relay, malware scanning, and document transformation). The crucial distinction lies in the difference between attempted and accepted bytes. A learner may obtain permission to upload but never submit; another might retry after a network issue; a third could replace the file before the deadline. If retention is only applied to rows marked \"submitted,\" abandoned objects may remain unaccounted for in the business database and evade the normal deletion process. To prevent this, give pending uploads a short, explicit expiry class, then reconcile storage inventory against upload intents. Do not treat cleanup as an afterthought, as it is a critical component of the system.\n\nAuditing storage has its own costs. Deleting raw uploads after a derived, scanned copy has been accepted reduces stored bytes and minimizes exposure. However, this also erases any evidence that could help resolve disputes during later parsing. Keeping intermediate versions enables easier investigation but increases both retained data and the scope of a privacy deletion. It is crucial to decide which artifact is authoritative, how long pending and rejected files should remain, and which immutable events prove creation, acceptance, replacement, and deletion. Removing duplicate retries, expired pending objects, and superseded drafts once the review window closes helps maintain a clean and efficient system.",
  "summary": "TL;DR For private course submissions, use presigned browser uploads when large files and application-server bandwidth dominate the cost model; use a server upload when inspection must happen before any byte reaches durable object storage. Keep authorization, object naming, finalization, and expiring downloads on the server in either design. CORS is only a browser permission boundary, not access…",
  "summary_source": "publisher",
  "key_points": [
    "Presigned browser uploads ideal for large files, high server costs",
    "Server uploads preferred for document inspection before storage",
    "Cost analysis includes storage, uploads, downloads, delivery, compute"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}