List all files in a bucket
Lists all the files within a bucket.
- RLS policy permissions required:
buckets
table permissions: noneobjects
table permissions:select
- Refer to the Storage guide on how access control works
Parameters
- pathOptionalstring
The folder path.
- optionsOptionalSearchOptionslimitOptionalnumber
The number of files you want to be returned.
offsetOptionalnumberThe starting position.
searchOptionalstringThe search string to filter files by.
sortByOptionalSortByThe column to sort by. Can be any column inside a FileObject.
columnOptionalstringorderOptionalstring - parametersOptionalFetchParameterssignalOptionalAbortSignal
Pass in an AbortController's signal to cancel the request.
const { data, error } = await supabase
.storage
.from('avatars')
.list('folder', {
limit: 100,
offset: 0,
sortBy: { column: 'name', order: 'asc' },
})