Javascript Reference v2.0

Delete files in a bucket

Deletes files within the same bucket

  • RLS policy permissions required:
    • buckets table permissions: none
    • objects table permissions: delete and select
  • Refer to the Storage guide on how access control works
Parameters
    paths
    REQUIRED
    string[]

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


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