title: javaScript upload multiple files - when it has finished
body: <p>I have this javascript function to upload files and I want to know when all files are uploaded, so when upload of multiple files has finished. 
  Is there a possibility to do this?</p>
  
  <pre><code>function uploadFiles(files, userId, projectId, successCallback, progressCallback) {
          if (files &amp;&amp; files.length) {
              for (var i = 0; i &lt; files.length; i++) {
                var file = files[i];
                if (!file.$error) {
                  Upload.upload({
                      url: 'api/fileuploads/fileupload/' + userId + '/' + projectId,
                      data: {
                        file: file  
                      }
                  }).then(function (resp) {
                      if (successCallback) {
                          successCallback(resp);
                      }
                  }, null, function (evt) {
                      var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
                      var log = 'progress: ' + progressPercentage + '% ' + evt.config.data.file.name + '\n';
                      if (progressCallback) {
                          progressCallback(log);
                      }
                  });
                }
              }
          }
      };
  </code></pre>