Question:
Uploading files and JSON data in the same request with Angular

Add the following HTML template with form in the component.html

 

Add the following code to upload the image in the component.ts file async documentPhoto(event:any){ let data = new FormData(); data.append("imgfile", event.target.files[0]); let res:any =await this.custService.uploadImages(data); this.imgaepath=res.data; }

Adequate Infosoft

Adequate Infosoft

Submit
0 Answers