Skip to content
All projects

Project case study

Chunked File Storage API

A FastAPI service for direct and multipart uploads to MinIO, with MIME and size validation, SQLite metadata, chunk merging, and streamed downloads.

FastAPIMinIOSQLAlchemySQLite
Open source repository

The problem

Accept direct uploads and split uploads into validated parts before storing the completed object.

Request flow

  1. 01Validate file and upload session
  2. 02write numbered chunks
  3. 03verify and merge all chunks
  4. 04upload object and save metadata

Example route: POST /files/multipart/init

Implementation decisions

  • Support JPEG, PNG, PDF, and plain-text MIME types with a 10 MB maximum size.
  • Track upload IDs, expected chunk count, declared size, and file metadata in SQLAlchemy / SQLite.
  • Use UUID object names and stream downloads in 1 MB blocks.

Validation and failure handling

  • Reject invalid chunk numbers, missing chunks, and size mismatches.
  • Remove temporary chunks after a completed upload.