I have an ASP.NET MVC web application using in the .NET Framework 4.6.
I need to be able to upload files and then forward them to a ASP.NET Core 3.1 Web API.
The problem is I can't figure out how to send files from the client app to the API.
The API accepts a request like so:
public class ReportUploadRequest
{
public List<IFormFile> Files { get; set; }
public int FolderId { get; set; }
public int BrokerId { get; set; }
}
and the ASP.NET MVC application has a controller function that accepts a form submission and attempts to post to the API.
The files from the form are received in ASP.NET MVC like so:
HttpPostedFileBase[] Files
I cannot work out how to convert the HttpPostedFileBase[] Files files to the List<IFormFile> Files format required by the Web API.
I have tried to receive the files in my controller using List<IFormFile> Files but Files is null on submission
How do I prepare my form to be consumed in a format agreeable to the Web API?
