title: AngularJS how to send multipart/mixed
body: <p>I am working on a project where I have to upload a small bit of JSON with a file, working in AngularJS.</p>
  
  <p>I've written code using Danial Farid's angular-file-upload, and it is working, except, it always sends "multipart/form-data, boundary=&lt;whatever&gt;"</p>
  
  <p>However, I <em>MUST</em> use multipart/mixed.</p>
  
  <p>This is my call:</p>
  
  <pre><code>$scope.upload = $upload.upload({
    url: &lt;my url&gt;,
    method: 'POST',
    data: $scope.data,
          file: file,
  }).progress(function(evt) {
    console.log('percent: ' + parseInt(100.0 * evt.loaded / evt.total));
  }).success(function(data, status, headers, config) {
    // file is uploaded successfully
    console.log(data);
  });
  </code></pre>
  
  <p>Is there a way to modify the headers just before it gets sent?</p>
  
  <p>If not using his angular-file-upload, then by another method, hopefully without having to 'roll my own' function?</p>
  
  <p>Edit 1:</p>
  
  <p>I just cannot understand how it can be so difficult to make this change.  Of course you can add</p>
  
  <pre><code>headers: {'Content-Type': 'multipart/mixed'}
  </code></pre>
  
  <p>But this does absolutely NOTHING because there is no boundary.  Why can't there be a way to pull the boundary out?  Something like</p>
  
  <pre><code>headers: {'Content-Type': 'multipart/mixed, boundary=%b'}
  </code></pre>
  
  <p>I need to get this working ASAP.</p>