Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable from.remove() to delete folders #207

Open
RyanTippsTX opened this issue Oct 10, 2022 · 16 comments
Open

enable from.remove() to delete folders #207

RyanTippsTX opened this issue Oct 10, 2022 · 16 comments
Labels
enhancement New feature or request

Comments

@RyanTippsTX
Copy link

RyanTippsTX commented Oct 10, 2022

Feature request - delete folders

Is your feature request related to a problem? Please describe.

With supabase storage, folders are deleted automatically when their contents are deleted, but there's no way to delete a whole folder at once, and there's no (clean) way to delete empty folders.

Describe the solution you'd like

I would like for this to work:

const { data, error } = await supabase.storage
  .from('bucket')
  .remove(['path/to/folder'], {
    force: true, // required if folder isnt empty
  });

Describe alternatives you've considered

For 'empty folders' that were created in the supabase web app, they can apparently be deleted like this:

const { data, error } = await supabase.storage
      .from('bucket')
      .remove(['folder/.emptyFolderPlaceholder']);

^ but this is clunky, and you have to know that that placeholder file is there.

And for deleting a folder that has multiple contents, it can be done much more verbosely using .list() and .remove() , but this is a pain, especially if there are nested folders.

@RyanTippsTX RyanTippsTX added the enhancement New feature or request label Oct 10, 2022
@kiwicopple kiwicopple transferred this issue from supabase/supabase Oct 12, 2022
@inian inian transferred this issue from supabase/storage-js Oct 12, 2022
@fenos
Copy link
Contributor

fenos commented Oct 21, 2022

Hello @RyanTippsTX thanks for the feature request!
This is something we are exploring and are very eager to implement in near future.

We are just finalizing a few requirements before we get there, for example, we'll need a queue-worker implementation for this to be working reliably.

The good news is that we are already building another feature that requires queue workers, so this will be the next one!

@madeleineostoja
Copy link

Excellent to hear @fenos, this is a pretty basic requirement and I was surprised to see it's not implemented. Passing every file in a folder to remove in a single array call feels error prone, especially in folders with large numbers of assets.

Do you have any rough ETA for this, and is there a beta waitlist I can go on?

@IzakJackson
Copy link

+1 for this. Any eta?

@Mikilll94
Copy link

I need this also

@max-programming
Copy link

This solution by @halindraprakoso helped me to delete a folder. First, delete all the files and the folder will get deleted
https://github.com/orgs/supabase/discussions/4218#discussioncomment-1733111

@ffaubert
Copy link

+1 any eta?

@ehowey
Copy link

ehowey commented Nov 21, 2023

Still need this...

@michaelessiet
Copy link

This feature would be much appreciated

@ChristopherForrest
Copy link

ChristopherForrest commented Dec 3, 2023

Please include this feature the workaround for this adds unnecessary complexity to a simple task.

@alaincruz06
Copy link

Watching this and hoping it gets implemented soon

@theitaliandev
Copy link

Waiting for this to be implemented...

@codingknite
Copy link

Really needed to do this today haha, hoping to see it soon :)

@drewhirschi
Copy link

Also +1

@martijnvanderpol
Copy link

+1

It would be incredible if this feature could be supported. My current setup involves a folder structure organized by an ID, with subfolders within that main folder related to the ID. Being able to simply remove the parent folder and automatically delete all associated subfolders would be a game changer. As it stands, I have to navigate through several loops to achieve this, which is far from ideal.

@madeleineostoja
Copy link

Everyone please stop commenting the equivalent of +1, that’s what votes are for and it clogs up the inbox of everyone subscribed to this issue

@PaperPrototype
Copy link

PaperPrototype commented Apr 29, 2024

@madeleineostoja how do I vote? Lol, did you thumbs down everyone for saying "+1"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests