Nodejs-storage: file.publicUrl() returns a Promise instead of the publicUrl

Created on 24 Nov 2020  路  3Comments  路  Source: googleapis/nodejs-storage

Steps to reproduce

const bucket = storage.bucket(bucketName);
const file = bucket.file(filename);
const publicUrl = file.publicUrl();
storage p2 bug

Most helpful comment

All 3 comments

It still not working. I got undefined when I call file.publicUrl.

It still not working. I got undefined when I call file.publicUrl.

@soraxtend is your file already public? It can be made public by calling await storage.bucket(bucketName).file(filename).makePublic();

Was this page helpful?
0 / 5 - 0 ratings