Overview
Admins should be able to choose to store images locally on their server.
Implementation
First thoughts:
- Create a new top-level empty directory in the project: media
- Uploaded files should be stored here
- Add an application handler that respects the Private config setting, and serves files from this directory
- If private = false, always serve file from this directory
- If private = true, only serve file if user is currently authenticated (whether via cookie or Authorization header (token))
- Additionally, we might store a bit of metadata in a new database table:
- filename - the uploaded file's name
- owner_id - ID of the user who uploaded the file (could enable moderation, and full data removal when an account is deleted)
- created - time and date the file was uploaded (could be used for enforcing per-time-interval restrictions)
- size - the size of the file (could be used for enforcing data quotas, and reports for admins)