Last active
August 7, 2020 19:06
-
-
Save adri567/6cca1baa11558c7ddd5af2a8c79b0f74 to your computer and use it in GitHub Desktop.
python script that allows you to upload image to firebase storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase_admin | |
from firebase_admin import credentials | |
from firebase_admin import storage | |
import os | |
cred = credentials.Certificate("path/to/certificate.json") | |
firebase_admin.initialize_app(cred, { 'storageBucket' : '<AppName>.appspot.com'}) | |
directory = '/Users/name/Desktop/TestOrdner/' | |
for filename in os.listdir(directory): | |
blob = bucket.blob(f'Ordner/ {filename}') | |
imagePath = directory + filename | |
blob.upload_from_filename(imagePath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment