我可以用python上传图像到防火墙存储。但是我找不到如何用python下载图像到firebase存储。
发布于 2022-08-18 13:01:07
这与How do I get url with token of uploaded file to firebase storage?的问题类似
将安全规则更改为该特定文件夹
Client SDK
完成,而在Admin SDK
for firebase-admin
python中不可用。rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Explicitly define rules for the 'path/to/myfile/' pattern
match /path/to/myfile/{allPaths}{
allow write: if request.auth != null; // Only Auth person can read
allow read: if request.auth == null; // Anyone can read
}
// This will be defined for everything else
match /{allPaths=**} {
allow write: if request.auth != null; // Only auth person can write
allow read: if request.auth != null; // Only auth person can read
}
}
}
示例python代码
storageBucket='myapp.appspot.com'
bucket_path="path/to/myfile/temp.mp3"
firebase_storageURL = 'https://firebasestorage.googleapis.com/v0/b/{}/o/{}?alt=media'.format(storageBucket, bucket_path)
https://stackoverflow.com/questions/45904099
复制相似问题