title: ng-flow setting CSRF token on header
body: <p>i could not find a way setting the X-XSRF-TOKEN header when using file uploads with flow.js.</p>
  
  <p>Since flow.js seems to not use the $http resource to post files i need to set the header explicitly.</p>
  
  <p>Here is what is did:</p>
  
  <p><strong>profile.edit.html:</strong></p>
  
  <pre><code>&lt;div class="row" flow-init="{target: 'rest/account/uploadImage'}" 
                          flow-file-added="processFiles($file, $event, $flow)"
                          flow-files-submitted="$flow.upload()" &gt;
  ...
  &lt;img type="file" flow-btn ng-if="$flow.files.length" flow-img="$flow.files[$flow.files.length-1]" class="img-circle m-t-xs img-responsive" /&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>controller.js:</strong></p>
  
  <pre><code>function profileCtrl($rootScope, $scope, $http, $location, $window, $cookies, toaster, 
  
      $scope.processFiles = function(file, event, flow) {
          flow.defaults.headers = function(file, chunk, isTest) {
              return {
                  'X-CSRFToken': $cookies.get("csrftoken")
      };}
  </code></pre>
  
  <p>But unfortunally nothing is set. Any ideas?</p>
  
  <p>Cheers!</p>