Skip to main content
Version: v2 RC

from.list()

Lists all the files within a bucket.

const { data, error } = await supabase
.storage
.from('avatars')
.list('folder', {
limit: 100,
offset: 0,
sortBy: { column: 'name', order: 'asc' },
})

Parameters

  • pathoptionalstring

    The folder path.

  • SearchOptionsrequiredobject

    No description provided.

      Properties
    • limitoptionalnumber

      The number of files you want to be returned.

    • offsetoptionalnumber

      The starting position.

    • searchoptionalstring

      The search string to filter files by.

    • sortByoptionalSortBy

      The column to sort by. Can be any column inside a FileObject.

  • FetchParametersrequiredobject

    No description provided.

      Properties
    • signaloptionalAbortSignal

      Pass in an AbortController's signal to cancel the request.

Notes

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

Examples

List files in a bucket

const { data, error } = await supabase
.storage
.from('avatars')
.list('folder', {
limit: 100,
offset: 0,
sortBy: { column: 'name', order: 'asc' },
})

Search files in a bucket

const { data, error } = await supabase
.storage
.from('avatars')
.list('folder', {
limit: 100,
offset: 0,
sortBy: { column: 'name', order: 'asc' },
search: 'jon'
})