I got it working. There are two things that I was missing:
of
and not in
..ts
//
for (let file of this.supportDocuments) {
// file is a blob object
formData.append("files", file);
}
this.uploadService.uploadFiles(formData)
routeBuilder.MapPost("api/cancellationforms/upload",
(IFormFileCollection files,
[FromServices] IServiceManager serviceManager,
CancellationToken cancellationToken) =>
{
// Iterate each file if needed
foreach (IFormFile file in files)
{
}
return Results.Ok("Hello");
})