Get Download URL from file uploaded with Cloud Functions for Firebase

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

    For those trying to use the token parameter to share the file and would like to use gsutil command, here is how I did it:

    First you need to authenticate by running: gcloud auth

    Then run:

    gsutil setmeta -h "x-goog-meta-firebaseStorageDownloadTokens:$FILE_TOKEN" gs://$FIREBASE_REPO/$FILE_NAME

    Then you can download the file with the following link:

    https://firebasestorage.googleapis.com/v0/b/$FIREBASE_REPO/o/$FILE_NAME?alt=media&token=$FILE_TOKEN

提交回复
热议问题