I'm trying to down load the file(pdf,word,excel) which is saved as bytes[] in DB and below is my code. But getting error(Unexpected token error) when calling the method the method. Please guide me to fix it.
Controller Code:
[HttpPost]
        public async Task<FileResult> AttachmentById([FromBody]ReviewAttachmentModel attachmentRequest)
        {
            ReviewAttachmentModel model = new ReviewAttachmentModel();
            try
            {
                ReviewAttachmentDto reviewAttachmentDto = new ReviewAttachmentDto
                {
                    DocumentKey = attachmentRequest.DocumentKey,
                    ReviewKey = attachmentRequest.ReviewKey,
                    UserId = attachmentRequest.UserId,
                };
                ReviewAttachmentDto _attachmentDto = reviewAttachmentDto;
                string requestBody = JsonConvert.SerializeObject(_attachmentDto);
                //Call API
                string _responseObj = await WebAPIHelper.PostDataToAPI(appSettings.ReviewAttachmentUrl, requestBody, this.loggedinUser.CookieCollection, accessToken);
                model = JsonConvert.DeserializeObject<ReviewAttachmentModel>(_responseObj);
               //  model.Document - byte[]
                return File(model.Document, model.DocumentType, model.DocumentName);
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Service.ts:
public downloadReviewAttachment(reviewAttachmentModel: any): Observable<any> {
    this._urlSurveillanceDetails = this.baseHref + "/ReviewProfile/AttachmentById";
    const headers: HttpHeaders = new HttpHeaders();
    headers.append('Content-Type', 'application/octet-stream');
    return this.http.post<any>(this._urlSurveillanceDetails, reviewAttachmentModel, { headers: headers });
  }
Component.ts:
onAttachmentDownload(documentKey: any, reviewKey: any) {
      let reviewAttachmentModel: any = {
        documentKey: documentKey,
        reviewKey: reviewKey
      };
    this._surveillanceService.downloadReviewAttachment(reviewAttachmentModel).subscribe(data => {
      if (data != undefined) {
      }
    })
  }

 
     
    