0

I have been trying to get the download links for all the images stored in my firebase storage bucket but i haven't been successful in doing so. I can manually retrieve the download link for 1 image but not all the images.

function getlink(){
         var storage = firebase.storage();
         var gsReference = storage.refFromURL("bucketLink");
         gsReference.child('/53233').getDownloadURL().then(function(url) {
         // This can be inserted into an <img> tag
         // This can also be downloaded directly
         console.log(url);
         }).catch(function(error) {
         // Handle errors
         console.log("error getting links");
        });
}

I want to get all the download links of the images present in the bucket and store them in an array.

Sukrit Kumar
  • 375
  • 4
  • 20
  • 2
    *firebaser here* There is currently no API to get a list of all files in a folder/bucket. We recommend storing the list of download URLs somewhere else, for example in the Firebase Database. See http://stackoverflow.com/questions/37335102/how-to-get-an-array-with-all-pictures – Frank van Puffelen May 22 '16 at 04:27
  • Thats a great idea, Thanks for the help – Sukrit Kumar May 22 '16 at 04:29

0 Answers0