Forum Academy Marketplace Showcase Pricing Features

Deleting files: MultiFile Uploader

Hi everyone,

I’m having problems deleting files that have been uploaded via the multi file uploader. The DB is Bubble’s AWS instance.

I’ve run the step by step debugger and things seem to be pointed in the right places.

When you click the X in the UI, a workflow sets off an action to delete an uploaded file (correct S3 location and file looks good to me).

Appreciate any guidance!

Screen Shot 2020-09-11 at 9.10.04 PM Screen Shot 2020-09-11 at 9.14.49 PM

How are you verifying that the files aren’t being deleted? Is it from the file manager in the editor? If so, did you make sure to refresh the file uploaded once a file has been deleted via your workflow?

Hi Johnny,

The files/file URLS are still in the users DB record on the backend. Also, they remain in the UI as well.

Screen Shot 2020-09-12 at 10.16.24 AM Screen Shot 2020-09-12 at 10.16.52 AM

Deleting an uploaded file from Bubble storage does not automatically remove DB references to that file. You must explicitly remove/delete file(s) from any Things in the DB. Similarly, removing a file reference from the DB does not automatically delete the actual file. An uploaded file can have more than one reference to it in the DB.

You can see how I did it in my Upload Buddy demo. Just go to Edit Mode from the menu and see the workflow for the trash can icon.

-Steve


Premium Bubble Plug-Ins

Thanks, Steve. That makes sense.

When I look at your editor, it looks like you are 1) deleting an uploaded file and then 2) uploading a deleted thing. My step 1 aligns with yours. There doesn’t seem to be a problem there. Step 2, however, is a different story. Your Step 2 has a “current cell” reference and mine does not. Any guesses?!

First screen shot is mine. Second is yours for delete a thing.
Screen Shot 2020-09-12 at 11.44.00 AM
Screen Shot 2020-09-12 at 11.49.03 AM

Not sure what you were looking at, but this is the workflow I was referring to…

It simply shows a busy indicator, deletes the file from Bubble storage, deletes the file reference from the DB, and then hides the busy indicator. (Your comment about “uploading a deleted thing” doesn’t make any sense.)

What’s the type of Thing being listed in your RG? That’s probably what you want to remove…or the file associated with it.

Ok, so it seems the file reference should be removed/deleted from that user.

Shot, I was referring to action steps 2 and 3 in your 4 step flow. Step 2 seems to be Data->Delete an uploaded file while step 3 seems to be Data->Delete a thing.

Delete a File
Screen Shot 2020-09-12 at 12.54.29 PM

Delete a thing (in this case, reference to file in Bubble’s DB)
Screen Shot 2020-09-12 at 12.54.36 PM

To answer your follow-up post, the “Thing” that my RG references is a File.
Screen Shot 2020-09-12 at 12.58.49 PM

Okay. I’ve made some progress.

I have rewritten an expression to do a search in the data type (Applications in my case) data field type (Documents - where my files are stored for each user).

While this does delete the files in Bubble, it deletes all of them, not just the one that I had intended. Furthermore, it deletes the Application (think job application) record and not just the single document associated with that Application.

I think the final solution will involve including a :minus item expression (correct me if I’m wrong, please) to delete just the intended file while leaving the rest of them alone.

Am I off base or is there agreement that this should solve the problem? Thanks!

Glad you got it remedied.

However, if you mark an issue as “solved”, that post should actually contain a solution. Simply announcing that you solved it without saying how is not helpful to those who stumble upon the thread later (which is the whole point of marking something “solved”).

Noted, Shot, and reopened with an edit.

Okay. I’ve made some progress.

I have rewritten an expression to do a search in the data type (Applications in my case) data field type (Documents - where my files are stored for each user).

While this does delete the files in Bubble, it deletes all of them, not just the one that I had intended. Furthermore, it deletes the Application (think job application) record and not just the single document associated with that Application. This leads me to believe that I need to continue the expression on the right where it says “Delete Application”. Something to the effect of “Search for Applications Documents minus item current cell’s file” so that it looks in the application data table in the documents folder and then looks for a specific file within it. I’m trying that, though, and the expression doesn’t give me the blue (all good) lock. Hmmm.

It feels like I’m close. Any suggestions? Thanks.

I solved it. The solution involved Making Changes to a Thing not Deleting a Thing. This allowed me to specify the object that needed to be modified without deleting the entire record.

Screen Shot 2020-09-14 at 5.00.46 PM

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