next-s3-upload icon indicating copy to clipboard operation
next-s3-upload copied to clipboard

Delete images / files from S3

Open p-christ opened this issue 3 years ago • 6 comments

hi, this repo is amazing!! Really great job, it's so helpful for us... I wanted to ask if you could add the possibility to delete things from s3 aswell as upload?

p-christ avatar Mar 24 '22 08:03 p-christ

I think this would be a great enhancement to this project. It seems like it was already set up to do this as it has a useS3Upload hook and could probably easily implement a useS3Delete hook.

masnwilliams avatar Mar 24 '22 17:03 masnwilliams

Thanks for opening an issue.

This feature gets asked about a lot. It's hard for this library to safely provide a delete hook because you could end up in a situation where one user starts deleting another user's uploads. I think most people using this library are going to want some sort of auth around deletes.

That said this gets asked about all the time, so I think the first step is some documentation showing people how to setup their own API route that can delete files.

ryanto avatar Apr 04 '22 15:04 ryanto

Any news on this delete function? Would be great a way to implement / hack to make it possible..

ssoronid avatar Dec 23 '22 11:12 ssoronid

... I think most people using this library are going to want some sort of auth around deletes.

@ryanto That is out of the scope of this lib, no? Such an authorization mechanism should be handled on the auth layer of the target app.

I wanted to fork this package and add such functionality, but when inspecting the code, I noticed that it has hardcoded stuff (on the server side) to do just the upload.

Since it seems like more work to redo that part - I've decided to use this instead: https://www.npmjs.com/package/s3-node

makivlach avatar Jan 12 '23 16:01 makivlach

@makivlach Yup! Auth is out of scope for this lib. You if you need full control over your deletes you're better off sticking with this library for uploads and using a server side library like the one you mentioned or the AWS SDK for deletes.

ryanto avatar Jan 12 '23 16:01 ryanto

@makivlach Yup! Auth is out of scope for this lib. You if you need full control over your deletes you're better off sticking with this library for uploads and using a server side library like the one you mentioned or the AWS SDK for deletes.

Thanks for this library and your advice on handling auth to the bucket

iukea1 avatar Jul 26 '23 10:07 iukea1