I’ve been looking for a solution to the issue of Ghost files remaining in File Manager where I have a Bubble multi-File Uploader (MFU) plugin on a page.
What was happening was that if someone removed a file from the multi-file uploader, using the ‘Remove File’ link on the MFU line item, the link would then be removed from the Thing in the database, but the file itself would not be remove - leaving a ghost file visible under file manager
The way I’ve addressed this is to add a ‘When File Uploader value changes’ workflow, and in there I set my Thing’s list to add the items in the MFU as below:
In this case, FPJobWorkSubmission is my Thing and it has a list of file attachments stored as a field called WorkSubmissionAttachments. When I add files to the MFU, even multiple at a time, it now adds them to the Thing in the Database. If I remove files from the MFU, it doesn’t change the list, so I always have a full list of every file which has been uploaded - so no more ghost files.
I’ve further added a ‘Reset relevant inputs’ step in the workflow so that the MFU resets back to the database list after each MFU change.
This means that although the user cannot click ‘remove file’ in the MFU, I can implement a function under each uploaded file (that I am displaying to the user via a repeating group) where I have a trash can icon that firstly deletes the file, then deletes the link as below:
This has caused me a reasonable amount of angst over the last day or two, so thought I’d share my solution here for others to take advantage of. Hopefully you’ll find it useful. I know it’s not perfect, but the removal of ghost files is worth the slight change in functionality for my users.