I'm using the angular file upload , it works great, but I need the feedback that the server me available. I'm using the following code:
$scope.uploader = new FileUploader({
url: 'https://api.imgur.com/3/image',
alias: 'image',
headers: {
Authorization: 'Client-ID XXXXXXXXXXXXXXXXXXXX',
},
autoUpload: true,
});
The answer:
{"data":{"id":"sK1PnoE","title":null,"description":null,"datetime":1454191817,"type":"image\/png","animated":false,"width":400,"height":400,"size":8981,"views":0,"bandwidth":0,"vote":null,"favorite":false,"nsfw":null,"section":null,"account_url":null,"account_id":0,"comment_preview":null,"deletehash":"LLLGwJ7PdzYsord","name":"","link":"http:\/\/i.imgur.com\/sK1PnoE.png"},"success":true,"status":200}
Edited ---
I can not access CallBacks methods, I tried the following ways:
$scope.uploader.onCompleteItem = function(fileItem, response, status,headers) {
console.log(response);
};
$scope.uploader = new FileUploader({
//xxxxx
}).onSuccessItem = function(fileItem, response, status,headers) {
console.log(response);
};