title: Why I cannot pass photos to asp.net mvc controller when using flow.js
body: <p>I am using ASP.net MVC and angularJS and try to upload photos to a DB with flow.js. However, I cannot find photos in my MVC controller. Did I miss anything? Thanks.
  Here are my codes:
  1) view</p>
  
  <pre><code>&lt;div ng-app="photo.upload" 
       ng-controller="psPhotoUploadController"
       style="max-height:930px; overflow-y:auto;padding-left:80px; padding-right:80px;"&gt;
      &lt;div flow-prevent-drop flow-drag-enter="dropClass='drag-over'" flow-drag-leave="dropClass=''"&gt;
          &lt;div flow-init 
               flow-file-added="!!{png:1,gif:1,jpg:1,jpeg:1}[$file.getExtension()]"&gt;
              &lt;div class="drop" flow-drop ng-class="dropClass"&gt;
                  &lt;span class="btn btn-default" flow-btn&gt;Upload Image&lt;/span&gt;
                  &lt;span class="btn btn-default" flow-btn flow-directory ng-show="$flow.supportDirectory"&gt;Upload Folder of Images&lt;/span&gt;
                  &lt;b&gt;OR&lt;/b&gt;
                  Drag And Drop your images here
                  &lt;span type="button" class="btn btn-default" style="color:blue; position:absolute; right:130px" ng-show="$flow.files.length" ng-click="uploadToDatabase($flow)"&gt;Upload&lt;/span&gt;
  
              &lt;/div&gt;
              &lt;br /&gt;
              &lt;div&gt;
                  &lt;div ng-repeat="file in $flow.files" class="gallery-box"&gt;
                      &lt;span class="title"&gt;{{file.name}}&lt;/span&gt;
                      &lt;div class="thumbnail" ng-show="$flow.files.length"&gt;
                          &lt;img flow-img="file" /&gt;
                      &lt;/div&gt;
                      &lt;div class="progress progress-striped" ng-class="{active: file.isUploading()}"&gt;
                          &lt;div class="progress-bar" role="progressbar"
                               aria-valuenow="{{file.progress() * 100}}"
                               aria-valuemin="0"
                               aria-valuemax="100"
                               ng-style="{width: (file.progress() * 100) + '%'}"&gt;
                              &lt;span class="sr-only"&gt;{{file.progress()}}% Complete&lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="btn-group"&gt;
                          &lt;a class="btn btn-xs btn-danger" ng-click="file.cancel()"&gt;
                              Remove
                          &lt;/a&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>2) typescript controller</p>
  
  <pre><code>namespace pspace.Controllers {
      var angularModule = angular
          .module("photo.upload");
      angularModule.config([
          "flowFactoryProvider", flowFactoryProvider =&gt; {
              flowFactoryProvider.defaults = {
                  target: "",
                  permanentErrors: [500, 501],
                  maxChunkRetries: 1,
                  chunkRetryInterval: 5000,
                  simultaneousUploads: 1
              };
          }
      ]);
  
      export class PsPhotoUploadController {
          static IID = "psPhotoUploadController";
          static $inject = ["$scope", "$http"];
  
          constructor($scope, $http) {
              $scope.uploadToDatabase = function ($flow) {
                  var formdata = new FormData();
                  angular.forEach($flow.files,
                      function(value, key) {
                          formdata.append(key, value);
                      });
                  var request = {
                      method: 'POST',
                      url: '/photos/UploadPhotos',
                      data: formdata,
                      headers: {
                          'Content-Type': undefined
                      }
                  };
                  $http(request)
                      .success(function(d) {
                          alert(d);
                      })
                      .error(function(e) {
                          alert(e);
                      });
              }
          }
      }
  
      angularModule.controller(PsPhotoUploadController.IID, PsPhotoUploadController);
  }
  </code></pre>
  
  <p>3) MVC c# controller</p>
  
  <pre><code>[HttpPost]
          public ActionResult UploadPhotos()
          {          
              var httpRequest = System.Web.HttpContext.Current.Request;
              if (httpRequest.Files.Count != 0)
              {
                 ///////The problem the Count is always 0
                 Upload to the DB
              }
              return null;
  
          }
  </code></pre>