I'm facing this error when I upload a product from Angular with it's image to NestJs Server,this error pops up.As you can see in the below screen shot, there is the uploaded product with image path,and also there's some error. I don't know which part/end generating this error.
Angular side code. From here the image is getting selected and uploaded alongside other properties
async addfile() {
let formData = new FormData();
formData.set(
'file',
this.AddbookForm.value.coverimage,
this.AddbookForm.value.coverimage.name
);
this.http
.post('http://localhost:3000/images/upload', formData)
.subscribe((res) => {});
}
async addbooks() {
(await this.apiService.addbooks(this.AddbookForm.value)).subscribe(
(res) => {
console.log(res);
}
);
}
async uploadimage(event: any) {
this.AddbookForm.value.coverimage = event.target.files[0];
console.log('file', this.AddbookForm.value.coverimage);
}
}