from.getPublicUrl()

获得公共bucket中资源的URL。

const { publicURL, error } = supabase
  .storage
  .from('public-bucket')
  .getPublicUrl('folder/avatar1.png')

Parameters

  • path required string

    要下载的文件路径,包括路径和文件名。例如`folder/image.png`。

Notes

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

Examples

返回一个公共bucket中资源的URL

const { publicURL, error } = supabase
  .storage
  .from('public-bucket')
  .getPublicUrl('folder/avatar1.png')

results matching ""

    No results matching ""