Get Download URL from file uploaded with Cloud Functions for Firebase

后端 未结 23 2351
春和景丽
春和景丽 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 02:10

    If you are getting error:

    Google Cloud Functions: require(…) is not a function

    try this:

    const {Storage} = require('@google-cloud/storage');
    const storage = new Storage({keyFilename: 'service-account-key.json'});
    const bucket = storage.bucket(object.bucket);
    const file = bucket.file(filePath);
    .....
    

提交回复
热议问题