Add question db insert.

This commit is contained in:
Cristiano Ferreira
2023-08-24 21:28:59 +01:00
parent 18bf6d59e0
commit ca6094c3e7
11 changed files with 1257 additions and 62 deletions

View File

@@ -9,7 +9,18 @@ def download_firebase_file(bucket_name, source_blob_name, destination_file_name)
print(f"File downloaded to {destination_file_name}")
return destination_file_name
def upload_file_firebase(bucket_name, destination_blob_name, source_file_name):
# Uploads a file to Firebase Storage.
storage_client = storage.Client()
bucket = storage_client.bucket(bucket_name)
try:
blob = bucket.blob(destination_blob_name)
blob.upload_from_filename(source_file_name)
print(f"File uploaded to {destination_blob_name}")
return True
except Exception as e:
print("Error uploading file to Google Cloud Storage:", e)
return False