I'm using https://www.npmjs.com/package/angular-file-uploader and I can't get the image object in the documentation of the library doesn't has anything about get the object of the image.
<angular-file-uploader #fileUpload1 [config]="afuConfig" [resetUpload]=resetVar (ApiResponse)="upload($event)">
</angular-file-uploader>
upload(img)
{
// let data = img.response;
this.book.image = img.response;
console.log(this.book.image);
}
this.afuConfig = {
multiple: false,
formatsAllowed: ".jpg,.png",
maxSize: "3",
uploadAPI: {
url:'http://localhost:3999/admin/' +'upload-avatar',
method:"PUT",
responseType: 'json',
},
theme: "dragNDrop",
hideProgressBar: true,
hideResetBtn: true,
hideSelectBtn: true,
fileNameIndex: true,
replaceTexts: {
selectFileBtn: 'Select Files',
resetBtn: 'Reset',
uploadBtn: 'Upload',
dragNDropBox: 'Drag N Drop',
attachPinBtn: 'Attach Files...',
afterUploadMsg_success: 'Successfully Uploaded !',
afterUploadMsg_error: 'Upload Failed !',
sizeLimit: 'Size Limit'
}
};
what must I put in upload() to get the image object and convert it to json. the backend is done in nodejs.