我想知道如何从我上传到Firebase存储的文件中获取URL?以下是我的代码:
import firebase_admin
from firebase_admin import credentials, firestore, storage
cred=credentials.Certificate('/serviceAccountKey.json')
firebase_admin.initialize_app(cred, {
'storageBucket': <my_bucket_name>
})
db = firestore.client()
bucket = storage.bucket()
blob = bucket.blob('image.jpg')
blob.upload_from_filename('/image.jpg')
#here I'd like to have url of file I uploaded
print(blob.<url>)
提前感谢您。
generate_signed_url
。详细信息可以在参考文档中找到。 - Jen Person