Shoto Todoroki
Shoto Todoroki

Reputation: 1

How to download file from firebase storage into particular directory using pyrebase

I am trying to download files from firebase storage using pyrebase. But I can only download in the root folder and not in any other folders I want. I tried the following codes

import pyrebase

config = {
  "apiKey": "apiKey",
  "authDomain": "projectId.firebaseapp.com",
  "databaseURL": "https://databaseName.firebaseio.com",
  "storageBucket": "projectId.appspot.com",
  "projectId":"projectId"
}

firebase = pyrebase.initialize_app(config)

storage =firebase.storage()

# this doesn't download the file in "images/downloads folder"
storage.child("image.png").download(os.path.join("images/downloads","image.png"),'image.png') 

# neither does this work
storage.child("image.png").download(path="completePath",filename="image.png")

# nor does this work
storage.child("image.png").download("images/downloads","image.png")

The image gets downloaded only in the directory I am in, and not in other directories. Can anyone tell how can I download the files in desired folder?

Upvotes: 0

Views: 727

Answers (1)

user1318359
user1318359

Reputation: 11

This only works with full path, not relative ones

Upvotes: 1

Related Questions