Open yashleo21 opened 7 years ago
I also would like to know if one can delete a file from Firebase Storage using Pyrebase
storage = firebase.storage()
storage.delete("test.txt")
I don't seem to be able, using storage.delete(item), or storage.delete(str(item)) to be able to get around this error:
.../pyrebase/pyrebase.py line 410 in delete self.bucket.delete_blob(name) AtttributeError: 'Storage' object has no attribute 'bucket'
help?
Nothing I have tried has worked, looking through the code there does seem to be a delete function in the Storage class however it does not work??
Hey guys I found the solution to the problem. You need service account credentials in order to be authorized to delete from storage. This link under "Add firebase to your app" will walk you through how to add service account credentials to your config which will allow you to delete from storage.
Once you download the .json file containing the key, add a line to your config dictionary
"serviceAccount":PATH_TO_JSON
(for python)
I am getting the same issue as earlier posters, AttributeError: 'Storage' object has not attribute 'bucket'
. I have my service account role set to Storage Admin. Is there another role I need to enable to be able to delete items?
I have also confirmed that I can add files to Storage using storage.child("test.txt").put("test.txt")
, so I am surprised that I cannot delete as well
@bloghran618 Did you solve the issue?
Not really, but I found a workaround to using Pyrebase
@bloghran618 How did you do it?
Well my application was written in Swift, just with a python backend, so I just had Swift delete the entry to firebase rather than use pyrebase
@janissary1 thanks so much!!! its work for me.... ;)
Is this feature supported by Pyrebase to delete a file from Firebase Storage? I cannot find any documentation related to it. Thanks in advance!