Auto Deleting 'Uploaded Files'

Hello,

I am trying to set up a backend workflow where files that users upload at automatically deleted from the ‘file manager’ section, after X amount of time (in my case it’ll be around ~6 hrs).

I have it set up so user clicks a button, it creates a list of images specific to that user, and those image files also show up under file manager.

Here is the current workflow I have set up for when they click this button and create that list of images:

After that I have later in the workflow to trigger a backend workflow,
here is my current backend workflow:


However, after testing this, it seems none of images (the list of images), or images made from that list in file manager get removed.

Any idea as to why?

Thanks :slight_smile:

Does the URL stored in the list have https: on the front of each list item entry?

1 Like

Yes, the images stored in the list have a link to an https://s3.amazonaws.com link

That’s not answering the question. Bubble’s URL behavior for files is… not what you expect. FYI.

1 Like

Can you elaborate please

Inspect the expression.

Hi @artistdata22

Keith is correct – after a second look at this. The code is not deleting the files but rather the first record returned from the DB (not the file).

I suggest that you will need to get the list of URLs and then recursively process the list and deleting one file per iteration.

@keith - What are your thoughts on this?

Regards, John

1 Like

File’s link or url or whatnot? I’m AFK at the moment. I’m just teaching the OP how to debug stuff.

2 Likes

image
Is this not looking for the URL’s tho?

each item’s images’s URL.

What else would it be?

Thanks

Sure but again is that the fully qualified URL or just the path? (Again, I have no idea what “Delete” is expecting, only that it’s borked.)

1 Like

Im Not really sure.

I just wanted to be able to auto-delete the files that users upload using the multi file uploader plugin im using in my app.

I wanted to automate this process so that I dont have to manually go in and delete when my storage is reaching capacity

The files they upload are automatically going to the file manager, but then they only register into this list when they click the submit button. Maybe theres a way to just auto clean the file manager with the file uploaded into it every X amount of hrs after that file is uploaded ?

I’m literally telling you what to do.

1 Like

So I locate the fully qualified URL and delete that from file manager after X amount of time in the backend workflow ?

I’m not saying to wait. (This is pointless… what if my device is tens of billions of times faster than yours?)

what do you mean?

Can anyone help with this?

This topic was automatically closed after 70 days. New replies are no longer allowed.