0

I am currently building a web app that uploads files in a folder in Firebase. Each time I upload a file in Firebase storage folder I also use Firebase database to store the file name and download URL. Is it possible to retrieve all files that are stored in the specific folder as an array so the user can choose which one he wants to download?

0

1 Answer 1

2

Since you are linking the url of the image in the database for example:

Uploads
  pushid
     urlfile: url_here
     uploadedby: userx
  pushid
     urlfile: url_here
     uploadedby: usery

you can change the database as you want

You can then do this:

firebase.database().ref("Uploads").orderByChild('urlfile').on('value', function(snapshot) {
snapshot.forEach(function(child) {
var files=child.val().urlfile;
 )};
)};

this way you can retrieve the urls from the database and then store them in an array using push()

Sign up to request clarification or add additional context in comments.

2 Comments

@user3397260 did the answer help?
It was very helpful man thank you but I treed a different approach, thanks for your response man

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.