2

I have a webcam so i need to capture a ID card and uploading the image for my angular project. anybody suggest me the simple npm library for do it.

1 Answers1

2

use formData upload like the method below:

 public upload(file: any): Observable<any> {

    let headers: HttpHeaders = new HttpHeaders();
    const params = new HttpParams();

    const formData: FormData = new FormData();
    if (file) {
      formData.append('file', file, file.name);
    }
    return this.http.put(this.Url, formData, { headers, params })
        .pipe(map((response: any) => {
          return response;
     }));
}
Ali Keserwan
  • 217
  • 1
  • 4