Currently you can use the angular-file-upload directive, which is simple / easy and supports file overflow and upload. It uses the boot pad before angular to be able to access the private XHR object in angular and attach an event event listener to it.
<div ng-controller="MyCtrl"> <input type="file" ng-file-select="onFileSelect($files)" multiple> </div>
JS:
//inject angular file upload directive. angular.module('myApp', ['angularFileUpload']); var MyCtrl = [ '$scope', '$upload', function($scope, $upload) { $scope.onFileSelect = function($files) { for (var i = 0; i < $files.length; i++) { var $file = $files[i]; $upload.upload({ url: 'my/upload/url', file: $file, progress: function(evt){ $scope.progress = parseInt(100.0 * evt.loaded / evt.total); } }).then(function(data, status, headers, config) { // file is uploaded successfully console.log(data); }); } } }];
source share