Delete a File is not deleting the file

I am using ‘Delete a file’ action.

But it doesn’t work. It doesn’t delete the file from the Bubble database and it is still available at the file URL in another browser (so isn’t cache).

How do I actually delete the file?

Editor below shows how the file is not getting deleted.

I am expecting the file to be deleted from Amazon.

Hi Jess :slight_smile: I think this may be because you have to first use the delete file action, and then set the field where the file was stored to be set empty in the second action. Here is the post which describes this:

Thanks Faye, I was missing that important step.

The actual problem though was the file wasn’t deleting at all (still showing, not showing xml). In the Forum4 test app I’ve found this was because I was attempting to delete the wrong thing, in my real app I still have to debug why it’s not deleting there, likely the same reason.

For anyone who is trying to debug and who is not sure what is supposed to happen. The path is:

A. Delete an Uploaded File (‘Current cell’s File’) =

  1. The file URL will now show Access Denied when accessing the URL eg.
  2. The file name and URL will still exist in your Thing.

Because you will likely not want to leave your DB cluttered with invalid files, you should also clear the File field in your Thing:
B. Change thing (file = [blank]) =

  1. The file name will no longer exist in your Thing after you click Edit Icon in the table, instead the File Upload button will show
  2. The file URL will no longer show in your Thing when looking at the table
  3. The URL or file will no longer display on the front end if you show it there

Jess

5 Likes

Post-solution note:
For anyone having the same problem, the reason I couldn’t delete the file was because I had set my repeating group type of content to be Thing’s File but it should just be file. Then when you Change the Thing in Step B. above you specifically look for Thing’s File there.

1 Like