title: Uploading file in API makes error 400
body: <p>I'm working on an API project which communicate with another API, my front is AngularJS</p>
  
  <p>I try to upload a file (a picture) an post it through an API which already works for other posts (other posts are not uploads, just data)</p>
  
  <p>I can upload the picture and treat it in a <code>formdata</code>, but when I try to post it, I have a 400 error with no '<code>Access-Control-Allow-Origin</code>'. But my others post methods work well but this one makes trouble.</p>
  
  <p>My Ajax post method:</p>
  
  <pre><code>apiDataService.postPicture = function(formData, callback) {
      $http({
          method: 'POST',
          url: apiUrl + '/pictures',
          data: formData,
          contentType: false,
          processData: false,
          headers: {
              'Authorization': localStorageService.get('auth')
          }
      }).then(function successCallback(response) {
          // retrieve response data
          callback(response.data);
      }, function errorCallback(response) {
          // an error occured
      });
  };
  </code></pre>
  
  <p>I took the pattern of my others post methods so, it would works...</p>
  
  <p>My uploading function:</p>
  
  <pre><code>self.addPicture = (image) =&gt; {
      var fileInput = document.getElementById('the-file');
      var file = fileInput.files[0];
      var formData = new FormData();
      formData.append('file', file);
      apiDataService.postPicture(formData);
  }
  </code></pre>
  
  <p>And my view:</p>
  
  <pre><code>&lt;form id="form-id"&gt;
      &lt;div class="col-xs-12"&gt;
          &lt;span&gt;Image :&lt;/span&gt;
          &lt;br/&gt;
          &lt;input id="the-file" type="file" placeholder="Image du Procédé" ng-model="picture.file" class="form-control" /&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-12"&gt;
          &lt;button ng-click="addPicture(image)"&gt;Enregistrer image&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>If you have any ideas, I don't understand my error...</p>