File Handling and Storage

Handle file upload, validation, processing, and delivery with predictable security and cost.

  • Store files in object storage, not application disks.
  • Use pre-signed upload/download flows where possible.
  • Scan and validate uploaded files before processing.

Alternatives and when to choose them

  • Direct app upload proxying for small internal tools.
  • CDN-backed private file delivery for public-scale assets.

Implementation checklist

  • Enforce max file size and allowed MIME types.
  • Separate original files from derived/processed assets.
  • Add lifecycle/retention policy by file category.

Common pitfalls

  • Trusting filename extension as content type.
  • Keeping user-uploaded content indefinitely without policy.

See also: Infrastructure setup

On this page