In my Angular application I am using a control: https://github.com/valor-software/ng2-file-upload
This control does a post with a file to my .NET core web API. Here is a short example, which is not really important.
public uploader: FileUploader = new FileUploader({url: `${environment.apiBaseUrl}/file`});
Eventually the control does a post to this .NET core web api action:
[Route("[controller]")]
public class FileController : Controller
{
[HttpPost]
public void Post(IFormFile uploadedFile)
{
var file = uploadedFile;
_fileSystemProvider.SaveToFileSystemAsync(_uploadSettings.GetReplacedDirectoryPath(), file.FileName, file.OpenReadStream());
}
}
The file upload is posting to the .NET web api, confirmed using the console in Chrome, but the uploadedFile parameter is
NULL
.
Why is this happening?