title: flow.js upload file on click
body: <p>Hopefully someone can help with this. </p>
  
  <p>Basically, we are using ng-flow <a href="https://github.com/flowjs/ng-flow" rel="nofollow">https://github.com/flowjs/ng-flow</a> to allow for drag and drop to upload items.
  We are also using MVC 4.</p>
  
  <p>All seems to be working as should, however, we would like to customize this, so that</p>
  
  <ol>
  <li>Items are dragged into the upload box and stored in scope (as it does now)</li>
  <li>Items are not physically uploaded until a button has been clicked</li>
  </ol>
  
  <p>What have we tried so far? :-</p>
  
  <p>in the config, we have disabled the target so that it doesn't upload immediately</p>
  
  <pre><code>.config(['flowFactoryProvider', function (flowFactoryProvider) {
  flowFactoryProvider.defaults = {
    target: '',
    permanentErrors: [500, 501],
    maxChunkRetries: 1,
    chunkRetryInterval: 5000,
    simultaneousUploads: 1
  };
  </code></pre>
  
  <p>on the actual page, we have created a button, with an ng-click which will pass through the flow.files</p>
  
  <pre><code>&lt;input type="button" value="Click Me" ng-click="uploadme($flow.files)"&gt;
  </code></pre>
  
  <p>in the controller, we have the function, uploadme, that accepts flows as a paramater.
  Looping through this paramater and post each "file" to the upload controller</p>
  
  <pre><code>$scope.uploadme= function (flows)
  {
      angular.forEach(flows, function (flow) {
          var fd = new FormData();
          fd.append("file", flow);
          $http.post("upload", fd, {
              withCredentials: true,
              headers: {'Content-Type': undefined },
              transformRequest: angular.identity
          })
      });
  
  }
  </code></pre>
  
  <p>MVC controller, 'upload'. this get called, however, file is always null</p>
  
  <pre><code>public ActionResult upload(HttpPostedFileBase file)
      {
          if (file.ContentLength &gt; 0)
          {
              var fileName = Path.GetFileName(file.FileName);
              var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
              file.SaveAs(path);
          }
          return View();
      } 
  </code></pre>
  
  <p>Is there something that we are missing? or is there a different way to achieve this. </p>