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?
Asked
Active
Viewed 3,398 times
1 Answers
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()

Peter Haddad
- 78,874
- 25
- 140
- 134
-
@user3397260 did the answer help? – Peter Haddad Mar 05 '18 at 10:46
-
It was very helpful man thank you but I treed a different approach, thanks for your response man – user3397260 Mar 05 '18 at 14:30