Hi folks, I’m having a a bit of a problem with deleting a file that’s uploaded via PictureUploader here, I would be really appreciated if someone can give me a hint of how to figure out this problem.
1, I’m making a custom printing T-shirt order app, each orders will be custom and unique.
2, User can upload and change their pictures via PictureUploader to try the look on the shirt .
3, I’m achieving this feature using two PictureUploaders (PU-A and PU-B).
The reason for having two uploaders is
- Bubble’s PictureUploader, by default, keeps adding pictures to DB(file manager) when you change a picture and weirdly “Delete uploaded file” event on the the same uploader will delete the one you just added. (This is dumb, I have reported a bug issue on this)
- I need to delete the first image from the DB(file manager) when the user uploads a new image, so I added another PictureUploder to make sure “Delete uploaded file” event works.
The Action Flow
User uploads img on PU-A >>> user checks >>> user uploads new img on PU-B >>> deletes img on PU-A by delete event >>> back to beginning, but this time delete img on PU-A
Doing this by show/hide PU-A and PU-B so the user won’t see both PU-A and B
and finally, here is my question for this topic.
How can I delete the uploaded image that didn’t use for an order? For ie… user failed to order, lost interest or closed the window whatever.
If I don’t delete this picture somehow (suspecting the backend workflow?) Bubble keeps adding unneeded images to the DB.
I see the unneeded uploaded picture has a user ID, maybe I can retrieve this to point out which photo to delete?