Get Download URL from file uploaded with Cloud Functions for Firebase

后端 未结 23 2410
春和景丽
春和景丽 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:59

    I had the same issue, however, I was looking at the code of the firebase function example instead of the README. And Answers on this thread didn't help either...

    You can avoid passing the config file by doing the following:

    Go to your project's Cloud Console > IAM & admin > IAM, Find the App Engine default service account and add the Service Account Token Creator role to that member. This will allow your app to create signed public URLs to the images.

    source: Automatically Generate Thumbnails function README

    Your role for app engine should look like this:

提交回复
热议问题