Skip to content Skip to sidebar Skip to footer

Empty File Stored On Firebase With Python

My goal is to generate certain files (txt/pdf/excel) on my Python server and subsequently push it to the Firebase Storage. For the Firebase Storage integration I use the pyrebase p

Solution 1:

The problem was that I opened my file with Write permissions only:

localFile = open(localFileName,"w+")

The solution was to close the write operation and opening it with Read permissions:

# close (Write)
localFile.close()

# Open (Read)
my_file       = open(localFileName, "rb")
my_bytes      = my_file.read()

# Store on FB
fbUploadObj   = storage.child(storageRef).put(my_bytes)

Post a Comment for "Empty File Stored On Firebase With Python"