SYNTIQORA SYSTEMS / DIGITAL SYSTEMS STUDIO
Private File Storage and Access-Controlled Downloads
Patterns for private upload storage, controlled downloads, transactional metadata, authorization checks, and recoverable backups.
Keep private bytes out of the public web root Private attachments should be stored in a controlled directory that the web server cannot serve directly. The database should retain the storage reference and validated metadata; a public URL should not reveal an internal path or allow a user to bypass the authorization layer. Validate the upload boundary Apply a maximum size, normalize filenames for display, determine MIME types safely, compute a checksum when useful, and write bytes before recording success. If the database transaction fails after a file is stored, clean up the orphan safely. Never report an upload as complete when the bytes or metadata failed to persist. Authorize every read and write A download endpoint should authenticate the requester, verify ownership or project membership, and return the same not-found response for inaccessible records where revealing existence would be unsafe. Deletion should coordinate the database record and filesystem file so a partial failure can be recovered. Back up the two layers Database exports do not contain external file bytes. Back up the database and configured private storage separately, protect both copies, and test restoration before production cutover.