from.list()

列出一个bucket内的所有文件。

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

参数

  • path optional undefined | string

    文件夹路径.
  • options optional SearchOptions

    搜索选项,包括`limit`、`offset`和`sortBy`。
  • parameters optional FetchParameters

    获取参数,当前仅支持 `signal`,这是一个AbortController的信号.

提示

  • 所需的策略权限:
    • buckets 权限: none
    • objects 权限: select

例子

列出一个bucket中所有文件

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

results matching ""

    No results matching ""