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 control.

The bill is not one number. A useful first approximation is stored byte-months + uploaded requests + downloaded requests + delivered bytes + application compute. For a deliberately illustrative cohort of 10,000 learners submitting one 20 MB document, one retained copy starts at 200 GB. If each document is downloaded three times, delivery moves 600 GB while storage remains 200 GB for that retention interval. Changing the upload path can remove 200 GB from the application server's inbound and outbound data path, but it cannot erase storage or download delivery. The dominant term depends on reuse: long retention emphasizes byte-months; repeated marking and review emphasizes delivered bytes.

That arithmetic changes the architecture discussion. “Easiest setup” is a poor invariant because the easy demo omits abandoned objects, replacement submissions, download authorization, and reconciliation. The smallest production design is a control plane that issues a narrowly scoped upload capability and a data plane that carries the bytes, followed by a finalization step that proves the expected object exists before the submission becomes visible.

What does the storage bill actually retain?

Start with a ledger, not a provider calculator. Give every attempted submission an immutable upload ID, record the expected maximum size and media type, and map it to an opaque object key such as courses/{courseID}/submissions/{uploadID}. The database row is the business record; the object is a payload. A user-supplied filename belongs in metadata after validation and must not become an authorization rule or a storage path.

For planning, model one cohort with variables rather than a price that will age:

Term Model What changes it
Retained data accepted bytes × retention time expiry, version policy, duplicate handling
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 + read operations multipart strategy, retries, polling
Application work bytes processed by the app relay, malware scanning, document transformation

The important distinction is attempted versus accepted bytes. A learner can obtain permission to upload and then close the tab; another can retry after a network transition; a third can replace a file before a deadline. If retention operates only on rows marked “submitted,” abandoned objects have no owner in the business database and can quietly remain outside the normal deletion path. Give pending uploads a short, explicit expiry class, then reconcile storage inventory against upload intents. Don't treat cleanup as an optional cron-shaped afterthought.

Retention has an audit cost too. Deleting the raw upload after a derived, scanned copy is accepted reduces stored bytes and limits exposure, but it also removes evidence that could explain a later parsing dispute. Keeping every intermediate version makes investigation easier and increases both retained data and the scope of a privacy deletion. There isn't a universal answer. The policy should state which artifact is authoritative, how long pending and rejected files remain, and which immutable events prove creation, acceptance, replacement, and deletion.

Stop keeping duplicate retries, expired pending objects, and superseded drafts once the declared review window closes. The catch is concrete: after deletion, an operator can prove from the audit event that a payload existed and was removed, but cannot reproduce a scanner decision or byte-level parsing result from that payload. If the institution needs later forensic replay, retain the authoritative input under a separately approved policy rather than allowing operational leftovers to become accidental archives.

How can direct browser uploads of user documents stay bounded?

Usually, yes, when the file may be large, the browser can send it without transformation, and the system can tolerate validation after arrival. A presigned upload keeps document bytes away from the web process while the server still decides who may write, where the object may land, how large it may be, and how long the capability remains valid. The server should generate the key. Never let the browser choose an arbitrary bucket path.

Choose a server upload instead when the application must reject content before durable storage, must transform a stream inline, or operates behind a network policy that permits only the application origin. A relay also centralizes request handling and avoids browser-to-storage CORS configuration. Its cost is coupling: application capacity, timeouts, backpressure, deployment rollouts, and memory discipline now sit in the document data path. For small enrollment forms with tightly capped attachments, that may be the correct trade. For multi-megabyte coursework at deadline peaks, it deserves load testing with slow clients, not just a happy-path local request.

Direct upload does not mean direct trust.

Bytes outlive intents.

Use a two-phase state machine: pending -> uploaded -> accepted, with rejected and expired as terminal alternatives. The browser first asks the application for an upload intent. The application authorizes the course and learner, fixes the object key and constraints, and returns a short-lived upload capability. After the transfer, the browser asks the application to finalize the upload; a worker or the application checks object metadata and runs required inspection before atomically accepting the submission. Repeating finalization with the same upload ID must return the same accepted record rather than create another submission. That is the exactly-once mindset applied to a system whose network delivery remains at least once.

Capability scope is an integration boundary

CORS answers whether browser code from an allowed origin may issue and read a cross-origin request. It does not authenticate the learner, make a bucket private, constrain a leaked signing credential, or authorize a future download. Keep the allowed origins exact, permit only the methods and headers the browser actually sends, and test the preflight request as part of deployment. A wildcard policy can make a prototype appear functional while erasing the origin boundary the production design expected.

The control-plane contract can stay small. This Go sketch intentionally leaves provider signing behind interfaces; the business rules remain testable without binding the application to one SDK.

package uploads import ( "context" "errors" "time" ) type Intent struct { ID string CourseID string LearnerID string ObjectKey string MaxBytes int64 ContentType string ExpiresAt time.Time } type SignedRequest struct { URL string Method string Headers map[string]string ExpiresAt time.Time } type Signer interface { SignUpload(ctx context.Context, key, contentType string, maxBytes int64, expiry time.Time) (SignedRequest, error) SignDownload(ctx context.Context, key string, expiry time.Time) (SignedRequest, error) } type Repository interface { CreateIntent(ctx context.Context, intent Intent, idempotencyKey string) (Intent, error) Accept(ctx context.Context, intentID string, observedBytes int64, checksum string) error } func ValidateObservedObject(intent Intent, size int64, contentType string) error { if time.Now().After(intent.ExpiresAt) { return errors.New("upload intent expired") } if size < 1 || size > intent.MaxBytes { return errors.New("object size outside authorized range") } if contentType != intent.ContentType { return errors.New("content type differs from upload intent") } return nil } 

The request returned by SignUpload is a capability, so log its issuance without logging the full signed URL. Audit records need the actor, upload ID, object key, constraints, expiry, decision, and correlation ID. They do not need a reusable secret. The same rule applies to download links: authenticate the viewer at the application, authorize that viewer against the course and submission, then issue a brief read capability for exactly one object. A database flag named private is meaningless if an object can also be read through a permanent public URL.

I'm not sure a single expiry duration is right across schools; the answer depends on observed transfer times, accessibility needs, and the institution's risk decision. What is stable is the relationship: upload expiry should cover a plausible transfer plus retry margin, while download expiry should cover a plausible read and no more. Measure expired-but-legitimate attempts before tightening either value.

Reconciliation tests the storage ledger

A 403 from the storage endpoint is not one diagnosis. It can mean an expired capability, a signature mismatch caused by a changed header, a disallowed origin observed through the browser, or an authorization policy that correctly denied the operation. Keep those categories distinct in application telemetry while returning restrained messages to the learner. Client code may retry a network interruption with the same upload intent when the capability remains valid; it should request a new authorized intent after expiry, and the server should decide whether that action is still allowed before the course deadline.

Checksums help identify corruption and duplicate retries, but a checksum is not a malware verdict and a matching filename proves nothing. Compare observed size and content type with the authorized intent, inspect the payload according to institutional policy, and accept the database transition only once. If inspection is asynchronous, do not issue a download capability while the object remains pending.

Test the awkward sequence: upload succeeds, finalization response is lost, and the browser repeats finalization. Test two tabs using the same submission slot. Test replacement immediately before a deadline, clock skew around capability expiry, an allowed origin with an unexpected header, a revoked enrollment, and deletion racing an authorized download. The acceptance invariant should survive all of them: one active authoritative submission per declared slot, with every state transition attributable and repeatable requests producing the prior result.

Keep the dashboard equally blunt. Track pending-object age, bytes with no matching intent, intents with no object, finalize latency, rejection reason, cleanup lag, signed-capability issuance, and authorized download count. Alert on reconciliation drift rather than raw request volume. A rising number of orphaned bytes is both a cost signal and evidence that the lifecycle model has stopped matching reality.

Deletion policy is data governance

Use presigned browser storage when moving bytes through the application would be the dominant operational burden and post-upload inspection is acceptable. Use a server relay when pre-storage inspection, transformation, or a constrained network boundary is more important than delivery simplicity. Stick with the relay for genuinely small, strictly bounded files if one ingress path makes operations easier; don't introduce a signing flow merely because direct upload sounds more advanced.

In both cases, keep one authoritative submission record, opaque server-selected keys, idempotent intent and finalization operations, explicit pending-object cleanup, auditable state changes, and per-request expiring downloads. Those controls decide whether private learner documents remain private. The transport path only decides where the bytes flow.

References

Further reading

The object-storage documentation above is the starting point for verifying the signing semantics, browser-origin configuration, request constraints, and lifecycle controls of a selected implementation before deployment.