The problem I am having is that the List of IFormFile is not being populated with the given files but when i call HttpContext.Request.Form.Files; then I have access to the files. I would prefer to use IFormFile as it seems to be new Dotnet core 2.0 way of doing things.
I have the following request payload:
With the following request headers:
And Razor pages handler:
public async Task<ActionResult> OnPostSend(ConditionResponse conditionResponse)
{
var files = HttpContext.Request.Form.Files;
}
Condition response model:
public class ConditionResponse
{
public List<string> Plots { get; set; }
public string Comments { get; set; }
public List<IFormFile> Files { get; set; }
}