There are various approaches. Right now we do the following:
- Upload a file, get back its "ID"
- Save that ID into client state
- Move to the data entry form
- Pass the ID to the database on form submission
This means you can upload files, abandon the process, and the files are left forever. We would have a hard time matching them to ensure which files we can delete. Not impossible, but a pain.
We could instead go to the database first, but that's also a bit of a pain.
- Go to the database and get an ID
- Upload the file with the ID
- Submit the ID along with the form data
In this scenario, how do we trigger an event to delete the file? It'd need to have some kind of timeout or whatever. That's not really clear. There's also no database event that we could rely on...