Last active
September 26, 2022 21:09
-
-
Save rbtrsv/8a5130c5312eb5fab738186156355b87 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 sys | |
| import firebase_admin | |
| from firebase_admin import credentials | |
| from firebase_admin import storage | |
| cred = credentials.Certificate('/Users/your.name/yada-yada-firebase-adminsdk.json') | |
| firebase_admin.initialize_app(cred, { | |
| 'storageBucket': '<yourstorage>.appspot.com' | |
| }) | |
| bucket = storage.bucket() | |
| blob = bucket.blob('folder_in_cloud/another_folder/name_of_file.txt') | |
| blob.upload_from_filename('/Users/your.name/yada-yada-file.txt') | |
| # If you want to dowload | |
| # blob.download_to_filename('/Users/your.name/yada-yada-file.txt') | |
| print(blob.public_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment