SCENARIO: I am using a file uploader to temporarily store files. Now I want to get rid of them automatically. I have no problem in using a “delete file” button or an automatic workflow that occurs at a specific time. My problem is this:
QUESTION: How do I automatically delete files AFTER the user has closed the page? It seems that in that instance the workflow deleting the files is not able to fetch the URL of the file uploader via “this file uploader’s value”.
Any suggestions?
It is, you just need to put that action in front of the action you use for navigating the user
If you are wanting to do this based on a user just leaving the page and not a navigation you setup, then need some javascript for event listeners to watch if user closes tab or moves to another page and on the event listener trigger schedule a backend workflow to delete the file.
If you only need a file temporarily, have you considered storing this in a custom state instead of the database?
A custom state will automatically reset as soon as a page is closed.