Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I get file from Firebase Storage while not knowing one child path?

I have this file path from Firebase Storage that I want to download:

/students/ekljfbwekncwlkjbweclk/gpas/this part is random/4

If I do not know the child path "this part is random", can still download the file?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried this:

firebaseStorageStudentRef.child("ekljfbwekncwlkjbweclk").child("gpas")
// This is what I tried
.child("*")
.child("4").downloadUrl.addOnSuccessListener { uri ->
   Log.i(TAG, "Success! Uri is: $uri")
}.addOnFailureListener { e ->
   Log.e(TAG, "Failed to retrieved photo. Exception is: $e")
}

>Solution :

You must know the full path of the file in order to download it.

The only way for a Firebase Storage client app to discover the name of a path component that you don’t know is using list API.

You’re probably better off recording that random bit somewhere in a database so you can more easily find and use it again.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading