title: Uploading an array of images to firebase storage
body: <p>I am trying to upload an array of images to firebase storage. I have written a function for single image upload and it works perfectly, but i cannot seem to wrap my head around how I can implement image array upload. Can someone kindly point me in the right direction. Below is my sample, and I have kept only the relevant part</p>
  
  <pre><code>        uploadAsync = async uri =&gt; {
            const user = Firebase.auth.currentUser.uid;
            const path = `users/${user}/images/${Math.round(
                    Math.random() * 1000000000
                )}.jpg`;
  
            return new Promise(async (res, rej) =&gt; {
              const response = await fetch(uri);
              const file = await response.blob();
  
              const upload = Firebase.storage().ref(path).put(file);
  
              upload.on(
                'state_changed',
                snapshot =&gt; {},
                err =&gt; {
                  rej(err);
                },
                async () =&gt; {
                  const url = await upload.snapshot.ref.getDownloadURL();
                  res(url);
                }
              );
            });
          };
  
          updateImage = async ({ image }) =&gt; {
            const user = Firebase.auth.currentUser.uid;
            for (let i = 0; i &lt; image.length; i++) {
              const file = image[i].image;
              const remoteUri = await this.uploadAsync(file);
              const firestoreRef = firebase.firestore().collection('Images').doc(user);
              firestoreRef.set({
                image: [remoteUri]
              });
            }
          }
  </code></pre>