.net core 2.2 & Angular 7: IFormFile in file upload controller is always null
Problem solved:
in service.ts it should be
const headers = new HttpHeaders().append('Content-Disposition', 'multipart/form-data');
instead of
const headers = new HttpHeaders().append('Content-Type', 'multipart/form-data');
Also in the .net controller, adding or removing [FromForm(Name = "file")] as parameter prefix does not change the behavior. It works perfectly fine with or without it. As hugo pointed out in the comments it's convention based as long as the param name matches to name in the form data.