Skip to content

Instantly share code, notes, and snippets.

@GeertVL-zz
Created February 4, 2014 15:12
Show Gist options
  • Save GeertVL-zz/8805490 to your computer and use it in GitHub Desktop.
Save GeertVL-zz/8805490 to your computer and use it in GitHub Desktop.
angular.module('myApp.controllers', []).
controller('MyCtrl1', ['$scope', function($scope) {
$scope.uploadFile = function() {
console.log("Uploading file");
for (var i = 0, f; f = $scope.files[i]; i++) {
var reader = new FileReader();
reader.onloadend = function(evt) {
if (evt.target.readyState == FileReader.DONE) {
console.log(evt.target.result);
}
};
reader.readAsBinaryString(f);
}
};
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment