title: How can i upload multiple files to firebase storage at once?
body: <p>I am creating an app in <code>ionic+angularfire2</code> and i want to upload some images to <code>firebase storage</code>, but i want to upload them all at once or at least <code>X</code> at the time <code>(x &gt; 1)</code>.</p>
  
  <p>right now i upload them like this</p>
  
  <pre><code>async imageUpload(name, file) {
      // The storage path
      const path = name;
      // The main task
      let img = 'data:image/jpg;base64,' + file;
      return this.task = this.afStorage.ref('/').child(name).putString(img, 'data_url').then((snapshot) =&gt; {
      console.log(snapshot)
  }).catch((err) =&gt; {
      console.log(err);
  });
  </code></pre>
  
  <p>}</p>
  
  <p>then i just loop trought the array that contains the files</p>
  
  <pre><code>let newDocId = this.afStore.createId();
  for (var i = 0; i &lt; this.lotProvider.uploadFoto.b64Image.length; i++) {
      let name = 'feriaganadera/'+newDocId +'/'+ (+ new Date()) + "-image_foto_jpeg_" + i + ".jpeg";
      this.imageUpload(name, this.lotProvider.uploadFoto.b64Image[i]);
  }
  </code></pre>
  
  <p>that work, the files are uploaded, but it has to wait for a file to upload the next one.</p>
  
  <p>How can i call the functions asynchronous? so <code>imageUpload</code> does not have to wait for the images.</p>