Add question db insert.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user