Skip to content

Remove the entire content of a folder in storage #4218

Discussion options

You must be logged in to vote

No. You can empty a bucket with a call or use the UI.
Otherwise you have to build up a list of file paths from the "folder" and remove them in a loop or as an array. I'm not sure how well that would work for large amount of files in a single call with an array, or looping in a database function. You probably need to run such code in a cloud function or on your server if you have one.
The new studio open source likely has examples of deleting all files in a folder as the user interface does that for you.

Replies: 3 comments 21 replies

Comment options

You must be logged in to vote
3 replies
@halindraprakoso
Comment options

@GaryAustin1
Comment options

@halindraprakoso
Comment options

Answer selected by halindraprakoso
Comment options

You must be logged in to vote
2 replies
@GaryAustin1
Comment options

@logemann
Comment options

Comment options

You must be logged in to vote
16 replies
@GaryAustin1
Comment options

@bart
Comment options

@GaryAustin1
Comment options

@bart
Comment options

@Andriiklymiuk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants