title: AngularJs Ajax POST form with file upload
body: <p>I'm trying to set up a form to be submitted using an ajax request to an api that has already been built using Ajax. For some reason the file just doesn't want to transfer to the system although there is already a back end built to handle this, and it works fine.</p>
  
  <p>My service looks like this based on a tutorial I found here: <a href="http://badwing.com/multipart-form-data-ajax-uploads-with-angularjs/" rel="nofollow noreferrer">http://badwing.com/multipart-form-data-ajax-uploads-with-angularjs/</a></p>
  
  <pre><code>addActivity: function(url){
      return $http({
          method: 'POST',
          url: REQUEST_URL + 'Volunteering/AddActivity?token=' + token + url,
          headers: {
              'Content-Type': 'multipart/form-data'
          },
          data: {
              file: $scope.file
          },
          transformRequest: formDataObject
      }).
      then(function(result) {
          console.log(result);
          return result.data;
      });
  },
  </code></pre>
  
  <p>I have a feeling it's just something really minor that i'm missing, can anyone offer some help?</p>