© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
Wei

Storage Upload Upsert (SET)

I am trying to upload a file to
avatars/<user_id>
avatars/<user_id>
with RLS
select
select
public read for anons,
insert
insert
and
update
update
for authenticated if
((bucket_id = 'avatars'::text) AND ((uid())::text = storage.filename(name)))
((bucket_id = 'avatars'::text) AND ((uid())::text = storage.filename(name)))

But update doesn't work. Upload works.
TS code for upload (create) only is
await supabase.storage
          .from('avatars')
          .upload(user.id, value.files[0]);
await supabase.storage
          .from('avatars')
          .upload(user.id, value.files[0]);

Update with upsert via upload method option returns
{
    "statusCode": "42501",
    "error": "",
    "message": "new row violates row-level security policy for table \"objects\""
}
{
    "statusCode": "42501",
    "error": "",
    "message": "new row violates row-level security policy for table \"objects\""
}

And update with or without upsert returns 404
Thank you!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

upload() upsert option
SupabaseSSupabase / help-and-questions
4y ago
Storage - dashboard upload
SupabaseSSupabase / help-and-questions
4mo ago
Storage upload issue
SupabaseSSupabase / help-and-questions
4y ago
Storage Upload Policies
SupabaseSSupabase / help-and-questions
4y ago