Delete uploaded file — how does it work?

I can’t seem to get this action to work. I click the button and the image remains. The field is a list of images, so maybe that matters? Do I need to remove the ‘s URL piece of the formula because I tried that too and it also didn’t work? Is there a lag of some kind before the image is removed from the database? I’m looking to eventually delete the thing that the image is attached to, but I know that the image will persist in the database once the thing is gone, which I don’t want. I don’t need the image anymore either, so I’m trying to delete the images first, but I can’t figure out why this action doesn’t work. Editor doesn’t show any error when I run the action step by step. Lots of forum posts with similar issues, but most are several years old and locked. By the way, trying to figure this out is absolutely destroying my workload for some reason! 25,000 units!

I guess you need to understand two things

A) The files itself

B) The reference to the file in DB (basically, in most case, the URL)

So when you use Delete a file, your action is on A) The file itself. But the B) is not deleted. So you need to remove the reference to the file in the field using make change to a thing.

Last thing, do you have the permission to delete the file? (privacy rules…)

And yes you can delete the ‘s url part.

Thank you! I think I understand the distinction as you describe it. But my assumption (perhaps wrong) is that when I delete the file (A), the image stored on the thing will disappear or create some sort of error as Bubble tries to show a file that no longer exists. I was hoping that would confirm the deletion before I delete the thing itself. My worry is that, once the thing itself is gone (B), it would be much harder to clear my file storage of the old images. I definitely have permission to view and change the images stored in the field on the thing. But is there some other privacy setting I’m missing somewhere else that affects the file manager?

You are right that if you delete the thing, it will be harder to retrieve and delete the file from front end after. So always better to first delete the file and after delete or update the thing.

However, your field is a list of files, so what you could do, if you need to delete the thing after the files, is to send the list of file to delete to a backend WF using Schedule API workflow on a list and delete the thing after (you don’t need to wait for the files to be deleted in backen WF to delete the thing in this case).

If the file is really deleted, yes you should get an error (in browser console logs) when you try to load the file and see a broken files thumbnails in DB backend view.