【问题标题】:Can you download an image with its URL using Firebase Functions?您可以使用 Firebase 函数下载带有 URL 的图像吗?
【发布时间】:2020-07-13 23:39:51
【问题描述】:

这就是网站所说的 - (https://firebase.google.com/docs/storage/extend-with-functions)

await bucket.file(filePath).download({destination: tempFilePath}); 

我想知道文件路径是否可以是 URL。

【问题讨论】:

标签: node.js firebase google-cloud-functions google-cloud-storage


【解决方案1】:

使用适用于 nodejs 的 Cloud Storage SDK 是不可能的。它对在 Firebase 客户端应用程序中创建的下载 URL 的工作原理一无所知。

如果您要存储有关图像的一些数据,我建议将图像的 URL 和路径都存储在存储桶中。然后,如果您需要在 Cloud Functions 中使用该路径,则可以在调用 bucket.file() 时使用该路径。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-15
    • 2018-05-02
    • 2018-01-09
    • 2018-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多