Files
A record can hold files: a receipt, a photo, a contract. Typestate stores them and gives each back only to the people the record allows.
How Typestate does it
- Your agent adds a file slot to a record type, with the kinds of file and the size it takes.
- Typestate checks each upload against the slot before it keeps it.
- Every read checks the rule of the record the file belongs to. A file goes when its record goes.
What you can do with it
- Keep an invoice PDF on each order.
- Take a profile photo, images only.
- Serve a public image to anyone with the link.
- Give a download link that stops working after a time.
What Typestate gives you
- Size
- 10 MB a file unless you set it, up to 100 MB
- Kinds
- image, PDF, document, spreadsheet, audio, video, archive
- One or many
- a slot keeps one file or a list of them
- Who may read
- the rule of the record, checked on every read
- Unused uploads
- removed within a day
Say this to your agent
Let a customer attach one PDF invoice to an order, at most 5 MB. Only that customer may read it.