How do I update a bucket path or upload if it doesn't already exist?
Right now I'm working on replacing user avatars if they don't already exist. The one problem with this is that update will fail if the file path doesn't exist. I wish it was smart enough to upload it to that path.
Is there a way to do this? I want to upload or update depending on if the file is there already.
let { error } = await supabase.storage .from('avatars') .update('123456/avatar', formData); if (error) { console.log(error); return; }
let { error } = await supabase.storage .from('avatars') .update('123456/avatar', formData); if (error) { console.log(error); return; }
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.