title: Upload angularjs file with progress percentage
body: <p>In my webapp i've got a service to upload files using angularjs and multipart upload. This is an example: <a href="https://jsfiddle.net/ZG9re/3909/" rel="nofollow">https://jsfiddle.net/ZG9re/3909/</a>
  It works perfectly but i can't understand how could see the percentage of the file during the upload. I don't want use <code>XMLHttpRequest</code> but i need to mantain this code if possible. This is the code anyway:</p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  
  myApp.directive('fileModel', ['$parse', function ($parse) {
      return {
          restrict: 'A',
          link: function(scope, element, attrs) {
              var model = $parse(attrs.fileModel);
              var modelSetter = model.assign;
  
              element.bind('change', function(){
                  scope.$apply(function(){
                      modelSetter(scope, element[0].files[0]);
                  });
              });
          }
      };
  }]);
  
  myApp.service('fileUpload', ['$http', function ($http) {
      this.uploadFileToUrl = function(file, uploadUrl){
          var fd = new FormData();
          fd.append('file', file);
          $http.post(uploadUrl, fd, {
              transformRequest: angular.identity,
              headers: {'Content-Type': undefined}
          })
          .success(function(){
          })
          .error(function(){
          });
      }
  }]);
  
  myApp.controller('myCtrl', ['$scope', 'fileUpload', function($scope, fileUpload){
  
      $scope.uploadFile = function(){
          var file = $scope.myFile;
          console.log('file is ' );
          console.dir(file);
          var uploadUrl = "/fileUpload";
          fileUpload.uploadFileToUrl(file, uploadUrl);
      };
  
  }]);
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;div ng-controller = "myCtrl"&gt;
      &lt;input type="file" file-model="myFile"/&gt;
      &lt;button ng-click="uploadFile()"&gt;upload me&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>thanks for help</p>