title: Dropbox file upload API to attach file with AngularJs
body: <p>I want to upload file to drop box using dropbox API. 
  I am referring to this <a href="https://www.dropbox.com/developers/documentation/http/documentation#files-upload," rel="nofollow" title="Dropbox official documentation">documentation</a>, based on that I have following code in my Angular application.</p>
  
  <p>Here suppose, I want to upload file myImage.jpg from my local c: directory to dropbox users root folder.</p>
  
  <pre><code> var headData = {"path": "/myImage.jpg", "mode": "add", "autorename": true, "mute": false };
      //So above path parameter pointing to Path in the my Dropbox root to save the file
  
      var config = {
          headers:  {
              'Authorization': 'Bearer &lt;I have my access Token here&gt;',
              'Dropbox-API-Arg': headData,
              'Content-Type': 'application/octet-stream'
          }
      };
  
      $scope.data = {};
  
      $scope.dropBoxAPI = "https://content.dropboxapi.com/2/files/upload";
  
      $http.post($scope.dropBoxAPI, $scope.data,config).success( function(response) {
          console.log(response);
      }); 
  </code></pre>
  
  <p>And, as API says it accept binary file which needs to be sent attached during post request.</p>
  
  <pre><code>--data-binary @C:\myImage.jpg
  </code></pre>
  
  <p>In above code <strong>$scope.data</strong> is completely empty as I don't know how do I use this to attach file. Please guide me, Is there something am doing wrong or missing anything?</p>