Get Download URL from file uploaded with Cloud Functions for Firebase

后端 未结 23 2211
春和景丽
春和景丽 2020-11-22 01:19

After uploading a file in Firebase Storage with Functions for Firebase, I\'d like to get the download url of the file.

I have this :

...

return buck         


        
23条回答
  •  不要未来只要你来
    2020-11-22 01:53

    This is the best I came up. It is redundant, but the only reasonable solution that worked for me.

    await bucket.upload(localFilePath, {destination: uploadPath, public: true});
    const f = await bucket.file(uploadPath)
    const meta = await f.getMetadata()
    console.log(meta[0].mediaLink)
    

提交回复
热议问题