1

I have created a function that can display different images inside a folder called image that is located in Firebase.storage. Inside the folder i have two images. Download.jpg and image.jpg. My source code is the following:

  display() {
    this.firestore.ref().child('image/image.jpg').getDownloadURL().then((url) => {
      this.zone.run(() => {
        const fileTransfer: TransferObject = this.transfer.create();
        this.imgsource = url;
        fileTransfer.download(url,'image/image.jpg').then((entry) => {
       console.log('download complete: ' + entry.toURL());


       }, (error) => {
      // handle error
       });
       })
    })
  }

In the example above the image -> image.jpg will be displayed in my application. How can edit my source code to just display the names of all the files inside the folder image and save the name of the one i want in to a variable?

I am quite new to Ionic and i cant figure a solution by my own, can anyone please help me?

Thanks in Regards

KENdi
  • 7,576
  • 2
  • 16
  • 31
user3397260
  • 241
  • 5
  • 17
  • There is no Firebase API to get a listing of the files in a Cloud Firestore folder. If you need to show a list of files, you will need to store that list elsewhere. See https://stackoverflow.com/questions/37335102/how-to-get-an-array-with-all-pictures – Frank van Puffelen Feb 02 '18 at 15:03

0 Answers0