[New Feature] Delete file action

We just added an action to delete a file from your application’s storage. You just need to specify the URL of the file to delete.

Keep in mind that deleting a file is different from modifying a thing, and the deletion of a file will NOT be undone by version control for the database. Use this action with caution!!

See more information here

13 Likes

Awesome! This will be super helpful. Still wish there were a way to query storage usage on an app so we can warn users of usage limitations. :sunglasses:

This is great. I’ve noticed files that have been left behind on aws, even after removing them from the site.

One question though: Will there ever be a way to directly access and manage a list of our files linked to our apps on aws?

2 Likes

So the difference is:

Make a change to a Thing: File field = blank
Field is blank, so you can’t access the file via a Thing, but the file still exists in storage, and if you know the URL, you can still access.

Delete an uploaded file
File is completely removed from storage.

Right?

4 Likes

This seems like a reasonable request. How do we know which files are available to delete if they’re not currently tied to a ‘thing’?

2 Likes

That’s on our list, yes. But no timeline yet.

3 Likes

Yes, that’s correct

2 Likes

I kinda agree but We shouldn’t celebrate an overdue feature by asking for something we could build ourselves in bubble.

Would it not be pretty simple to build an admin section RG of our app to accommodate uploaded files not tied to a thing and use that as our aws storage admin

5 Likes

Thanks for adding this feature! Where do we find this action? I’m not finding it.

It is in the data section of the actions menu.

Is this important because deleting the record won’t delete a file that is in the store and referred to by field in the deleted record?

Technically if you had the URL of the image you could get to the file even if the record had been deleted, correct?

If this is the case, then this was a really needed feature. Thanks

Direct the action to the full url, correct? I’ve pointed a workflow to a specific test file to delete but it still exists afterward.

Can you provide an example for people to test? Also, make sure to test if the file is there in incognito mode, it will be cached locally in the browser for a while.

https://forum_app.bubbleapps.io/version-test/delete_file_test?debug_mode=true

Using this test page, you can delete the file with no problems.

The file is set as a group state and the delete button deletes that group’s state file without problems.

How do you direct the action to a specific URL for files uploaded in the past?

I know the URL but can’t figure out how to set a state for that address using workflows.

I’ve tried setting a button action workflow that deletes the file URL but the file remains using this method.

It must be a formatting thing. In the test app, there’s an input with that fills in with the uploaded file’s URL. The delete button under it is pointed to delete that URL. I don’t think it is deleting the file.

So this page works fine. What is the issue here?

Right, this page works because the file is set as a state for the group. But how do you delete a file that is already uploaded and all that you have is its URL? I create an action to delete an uploaded file - I paste the URL but it doesn’t delete the file.

I thought of assigning the URL to a state on page load but it doesn’t look like you can assign files from URL in that kind of workflow.

How do you point the delete file action at a specific URL?

That’s why I have the other button and text input included below. The input has the URL address of the file you upload on the page. The button is set for a delete action and the URL is set as the input’s value. This doesn’t seem to delete the file either.

Can you share an example of a page with a URL that is not getting deleted. We need an actual URL to look at here

Sure thing -

I used the uploader on the test page to create this file:
https://s3.amazonaws.com/appforest_uf/f1502734695737x737390289548784500/test.pdf

I copied that into the input and the file deleted just fine.

What’s puzzling is that I’ve copied this exact process on my private app for a particular file that needs to be deleted. I paste the desired file URL into my private app’s input, click delete, and the file remains.

BTW, thanks for your help with this. I know you are very busy!

This file is deleted fine indeed.

Are you sure the file is not deleted. Keep in mind that the file can be cached by the browser, so if you hit the URL after a deletion it can still be here for some time.

2 Likes

Hello,

Same problem, I used this function to delete the file but this is not working. I can see the correct URL to be deleted but the URL remains eventhough I deleted the file and change browser (so not in the cache). I can also see the file(picture in this case) still remains in the database.

is there more actions to be done to delete this file?

Thanks