-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Allow the user to upload and overwrite if file already exists. #7
Comments
The backend for this has been implemented. We will need to update const { data, error } = await supabase
.storage
.from('avatars')
.upload('public/avatar1.png', avatarFile, { cacheControl: '3600', upsert: true }) Note the backend hasn't been rolled out to the supabase projects yet. So when implementing this feature, you will need to point to the locally running storage-api |
Although @inian I think, |
I am trying to mirror |
That sounds good |
🎉 This issue has been resolved in version 1.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks @inian, @ankitjena - you guys rock! |
Not sure if this feature request belongs here, or in the supabase/storage-api repository (or both).
Happy to re-open somewhere else if it doesn't belong here.
Feature request
A user should be able to include a flag in the
FileOptions
to replace/overwrite the file if it exists on upload.Is your feature request related to a problem? Please describe.
When I upload a file that already exists, I get an error:
Describe the solution you'd like
A boolean flag added
overwrite
added toFileOptions
that tells the storage-api that the file being uploaded should overwrite if the file exists at the destination.Describe alternatives you've considered
from(bucketName).list(fileName)
to checking if the file exists in the location before uploading, but this seems like an unnecessary API call.Additional context
As I mentioned at the top of the issue, this seems like it would probably need to be implemented in the supabase/storage-api repository, then implemented in all of the client libraries.
The text was updated successfully, but these errors were encountered: