Skip to main content

File Upload

Route

app/api/upload/route.ts — handles multipart form data.

Behavior

  • Max size: 50 MB
  • Files are written to public/assets/uploads/
  • Returns the public URL path for the uploaded file

Infrastructure requirement

public/assets/uploads/ must exist on the server and be mounted as a persistent Docker volume. Files written here are NOT committed to git.

  • Add a .gitkeep inside the directory to track it in the repo
  • Configure the volume in docker-compose.yml / Portainer stack

If the volume is not mounted, uploaded files will be lost on container restart.