Skip to content
Loading
  • 0
    thank you for reply
    if client side angular will be as you tell above 
    1. this.http.post('http://localhost:61265/api/DeliverySys/?selectedOwnerLevel=' + this.selectedOwnerLevel, formData,{ responseType: 'blob' })      
    2.     .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.xlsx'));      
    3.  }      
    can you tell me what web api will be  
    meaning can you please tell me what modification will do on web api please ? 
    0
  • 0
    when do that on angular client side 
    1. this.http.post('http://localhost:61265/api/DeliverySys/?selectedOwnerLevel=' + this.selectedOwnerLevel, formData,{ responseType: 'blob' })      
    2.     .subscribe((response: Blob) => saveAs(response, this.fileToUpload.name + '.xlsx'));      
    3.  }    
    so web api what will be ?? 
    web api will be as below 
    1. [HttpPost, DisableRequestSizeLimit]    
    2.         public IActionResult Upload(int selectedOwnerLevel)    
    3.         {    
    4.             try    
    5.             {    
    6.                 var DisplayFileName = Request.Form.Files[0];    
    7.                 string fileName = DisplayFileName.FileName.Replace(".xlsx", "-") + Guid.NewGuid().ToString() + ".xlsx";    
    8. }  
    9. }  
     or web api as above is wrong 
    0