from.getPublicUrl()
获得公共bucket中资源的URL。
const { publicURL, error } = supabase
.storage
.from('public-bucket')
.getPublicUrl('folder/avatar1.png')
参数
-
path required
string
要下载的文件路径,包括路径和文件名。例如`folder/image.png`。
提示
- 所需的策略权限:
buckets
权限: noneobjects
权限: none
例子
返回一个公共bucket中资源的URL
const { publicURL, error } = supabase
.storage
.from('public-bucket')
.getPublicUrl('folder/avatar1.png')