title: Angular Js File Upload
body: <p>i am new to angular js. i want to upload file using this.
  i used following link</p>
  
  <p><a href="http://jsfiddle.net/jasonals/WEvwz/27/" rel="nofollow">http://jsfiddle.net/jasonals/WEvwz/27/</a>?
  upload.html</p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://blueimp.github.com/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"&gt;&lt;/script&gt;
  &lt;script src="http://blueimp.github.com/jQuery-File-Upload/js/jquery.fileupload.js"&gt;&lt;/script&gt;
  &lt;div ng-controller='TestCtrl'&gt;
    &lt;div&gt;
        &lt;input id="fileupload" type="file" name="files[]" data-url="/" multiple&gt;
        &lt;ul&gt;
            &lt;li ng-repeat="file in fileList"&gt;
                {{file.name}}
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
  
    &lt;button ng-click='addButtonClicked()'&gt;Add File&lt;/button&gt;
  &lt;/div&gt;
  
  controlller file.
  $(document).ready(function(){
      $('#fileupload').fileupload({
          dataType: 'json'});
  });
  
  TestCtrl = function($scope){
      $scope.fileList = [];
      $('#fileupload').bind('fileuploadadd', function(e, data){
          // Add the files to the list
          numFiles = $scope.fileList.length
          for (var i=0; i &lt; data.files.length; ++i) {
              var file = data.files[i];
          // .$apply to update angular when something else makes changes
          $scope.$apply(
              $scope.fileList.push({name: file.name})
              );
          }
          // Begin upload immediately
          data.submit();
      });
      $scope.addButtonClicked = function(){
          var numFiles = $scope.fileList.length;
          $scope.fileList.push({name: ('fileName' + numFiles)});
      }
  }
  </code></pre>
  
  <p>but i am unable to post the url using this.</p>