[SOLVED] Preventing "orphaned" files - How would you handle it?

Not necessarily, but that might be the easiest way to go about it. Conceptually speaking, by “flag”, I simply mean there needs to be some way to “filter” uploaded files that you wish not to keep. It’s entirely up to you as to how that’s implemented. What’s key is that any file that you do wish to keep must not show up when the “flagged” search constraints are applied.

As outlined in a prior post, implementing a global “Garbage Collection” list is one approach. Just make sure files you do wish to keep do not appear in that list.

For example, let’s say you have a user profile page which allows a user to save information about themself, including a single profile image. A user might change their mind and have uploaded several photos before saving their profile. Each uploaded image could be added to the garbage collection list immediately upon upload. Then, when the profile is actually saved, the currently selected photo would be removed from that list.

I hope that makes sense. (Unfortunately, I don’t currently have an example to which I can provide edit access.)

EDIT: And if you’re dealing with images and wish to conserve your Bubble storage, you might take a look at Upload Buddy. It allows you to scale images before upload, thereby, saving bandwidth, user time, and Bubble storage.