angular.js binary file upload

علی ذوالفقار
1400/05/12 08:40:35 (625)
// angular-file-upload.min.js
//  https://github.com/nervgh/angular-file-upload
var app = angular.module('app', ['ngRoute', 'angularFileUpload']);
app.controller('myctrl', function ($scope, $rootScope, $http , FileUploader) {
    // setup with auto upload after select 
    $scope.uploader = new FileUploader({ 
		url: '/api/upload', 
		autoUpload: true, 
		removeAfterUpload :true 
		});
    $scope.uploader.onCompleteItem = function (item, response, status, headers) {
        console.log('UPLOAD-COMPLETE');
        console.log(response , status , item );
        $scope.uploader.clearQueue();
    };
});
Back