I am using this photo upload directive to upload images:
https://github.com/danialfarid/ng-file-upload
$scope.upload = function (files) {
if (files && files.length) {
for (var i = 0; i < files.length; i++) {
var file = files[i];
Upload.upload({
url: 'https://angular-file-upload-cors-srv.appspot.com/upload',
fields: {
'username': $scope.username
},
file: file
}).progress(function (evt) {
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
$scope.log = 'progress: ' + progressPercentage + '% ' +
evt.config.file.name + '\n' + $scope.log;
}).success(function (data, status, headers, config) {
$timeout(function() {
$scope.log = 'file: ' + config.file.name + ', Response: ' + JSON.stringify(data) + '\n' + $scope.log;
});
});
}
}
};
I need to add the ability to 'paste' an image from the clipboard and for that to be uploaded by ng-file-upload.
Could anyone give me pointers on how to do that?
contenteditableattribute and see if you can come up with a solution. Here is something to start off with: html5doctor.com/the-contenteditable-attribute