from.remove()

Deletes files within the same bucket

1const { data, error } = await supabase
2  .storage
3  .from('avatars')
4  .remove(['folder/avatar1.png'])

Parameters#

  • pathsrequired
    object

    An array of files to delete, including the path and file name. For example ['folder/image.png'].

Notes#

  • RLS policy permissions required:
    • buckets table permissions: none
    • objects table permissions: delete and select
  • Refer to the Storage guide on how access control works

Examples#

Delete file#

1const { data, error } = await supabase
2  .storage
3  .from('avatars')
4  .remove(['folder/avatar1.png'])