【发布时间】:2021-12-24 18:56:38
【问题描述】:
我想通过 firebase 函数获取 Google Cloud 存储中文件的可匿名下载链接。
从 JS SDK,您可以通过以下方式获得永久可下载的链接
const ref = storageRef.child('images/stars.jpg');
const url = await ref.getDownloadURL()
[1]。是否可以使用firebase-admin 或firebase/storage 从函数中做同样的事情?我只找到了一个签名的 url[2],有效期最长为 7 天。
[1]https://firebase.google.com/docs/storage/web/download-files
[2]https://cloud.google.com/storage/docs/access-control/signed-urls
【问题讨论】:
标签: firebase google-cloud-storage firebase-storage