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
path
Optional
stringThe folder path.
options
Optional
SearchOptionslimit
Optional
numberThe number of files you want to be returned.
offset
Optional
numberThe starting position.
search
Optional
stringThe search string to filter files by.
sortBy
Optional
SortByThe column to sort by. Can be any column inside a FileObject.
column
Optional
stringorder
Optional
stringparameters
Optional
FetchParameterssignal
Optional
AbortSignalPass 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' },
})