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

Amplify Storage remove folder #5841

Open
blasco opened this issue May 19, 2020 · 8 comments
Open

Amplify Storage remove folder #5841

blasco opened this issue May 19, 2020 · 8 comments
Labels
feature-request Request a new feature Storage Related to Storage components/category

Comments

@blasco
Copy link

blasco commented May 19, 2020

I can see many files for a given folder in s3, I can list the files with:

    const storedFiles = await Storage.list(`pathToFolder`);

and I can download the files with:

      const url: string = await Storage.get(fileKey) as string;
      window.open(url, '_blank');

The remove method doesn't through any error when I try to delete the folder, but it doesn't seem to work either.Is there a way to remove a folder and all files under it?

@attilah
Copy link

attilah commented May 19, 2020

This seems to be a AmplifyJS related issue, transferring to their repo.

@renebrandel renebrandel transferred this issue from aws-amplify/amplify-cli May 19, 2020
@sammartinez sammartinez added Storage Related to Storage components/category to-be-reproduced Used in order for Amplify to reproduce said issue labels May 19, 2020
@renebrandel renebrandel removed their assignment May 19, 2020
@ashika01 ashika01 self-assigned this May 21, 2020
@elorzafe
Copy link
Contributor

@blasco

The way to delete all the files under a prefix is by listing the files first and then delete each key one by one.

Buckets are not File systems, the bucket can be organized under prefixes so you can get the list of keys under the prefix but you cannot perform actions like the one you mention.

@elorzafe elorzafe added question General question pending-close-response-required and removed to-be-reproduced Used in order for Amplify to reproduce said issue labels May 28, 2020
@blasco
Copy link
Author

blasco commented May 28, 2020

@elorzafe It can be done in the web console though

@ashika01 ashika01 removed their assignment Jun 1, 2020
@ashika01
Copy link
Contributor

@blasco This is not possible right now. But I can mark this as feature request to bring this functionality into our storage category. The way to do this right now would be to do workaround @elorzafe suggested.

@ashika01 ashika01 added feature-request Request a new feature and removed question General question labels Jul 28, 2020
@IsaacTrevino
Copy link

+1 -R feature

@hanna-becker
Copy link

I know we can't delete "directories" through the S3 API, as the concept of directories does not exist in S3. However, I was expecting Storage to abstract this limitation away from us by offering an option to do that. After all, it is a wrapper that should simplify file handling for us.

@abdallahshaban557
Copy link
Contributor

Thank you all of the feedback on this feature request! We will provide updates when we have made some progress in creating in the abstraction needed here!

@Eliav2
Copy link

Eliav2 commented Jan 26, 2024

this is really weird that years has passed and this feature is not yet available. the SDK even not throws error or warning, it's just does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request a new feature Storage Related to Storage components/category
Projects
None yet
Development

No branches or pull requests

10 participants