next-s3-upload
next-s3-upload copied to clipboard
Delete images / files from S3
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?
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.
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.
Any news on this delete function? Would be great a way to implement / hack to make it possible..
... 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 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.
@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