Delete uploaded files attached to a thing?

Is there a way to systematically identify and delete uploaded files in Bubble that are attached to a specific thing?

I’m looking for a way to clean up files, ideally through a workflow or API, without having their URLs or references stored anywhere. What I know is the unique IDs of the things they are attached to.

Does any of the agents or any built-in functionality offer a solution for this?

I haven’t heard of agents being capable of doing such a thing, if that’s the case I would like to know.

If not, the short answer is no. Store the URL somewhere.

if the files are sitting in a field on the thing (like an image or file field), you can actually get the url from there. just do a search for the thing by its unique id, grab the file field value, and then use the “delete an uploaded file” action with that url. wrap it in a recursive backend workflow if you need to loop through a bunch of them.

now if the files were uploaded but the urls were never saved to any field on the thing… thats trickier. you’d probably need to hit the data api, pull the thing by unique id, and check each field for file urls that way. not the cleanest solution but it works.

You might be able to use the data storage to filter. I’m not sure if bubble has implemented that basic functionality yet though.