title: AngularJS image upload with PUT, possible, how?
body: <p>I'm trying to use AngularJS do upload an images with a PUT or Post request, is this possible, if so how as below does not change the header (still json) and there is no payload.</p>
  
  <p>This is what I have tried:</p>
  
  <p>in my controller:</p>
  
  <pre><code>       $scope.uploadFile = function (elm) {
  
              $scope.files = elm.files
              $scope.$apply();
  
              var fd = new FormData()
              fd.append('file', $scope.files[0])
  
  
              $scope.profile
  
                  .customPOST(fd, "", ["Content-Type", undefined])
               .withHttpConfig({
                      transformRequest: angular.identity
                  });
  
              event.preventDefault();
  
  
          };
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;input type="file" name="file" onchange="angular.element(this).scope().uploadFile(this.files)"/&gt;
  </code></pre>
  
  <p>This code actually gets the file name and add its to the database, but no file actually gets uploaded during the put request.</p>