title: Upload multiple files with parameters in ASP.NET Core
body: <p>My view model:</p>
  
  <pre><code>public class FileInfo
  {
      [Required]
      [StringLength(50, ErrorMessage = "TitleErrorMessage", MinimumLength = 2)]
      public string Title { get; set; }
  
      [Required]
      [StringLength(100, ErrorMessage = "DesErrorMessage", MinimumLength = 3)]
      public string Description { get; set; }
  
      [Required]
      [DataType(DataType.Upload)]
      public IFormFile File { get; set; }
  }
  </code></pre>
  
  <p>The following is _UploadForm partial view file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@model SessionStateTest.Models.FileInfo
  
  &lt;div class="form-group"&gt;
      &lt;label&gt;Title&lt;/label&gt;
      &lt;input class="form-control" asp-for="Title" /&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label&gt;Description&lt;/label&gt;
      &lt;input class="form-control" asp-for="Description" /&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label&gt;&lt;/label&gt;
      &lt;input type="file" asp-for="File" /&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>That is used in another View with this code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form asp-action="AddUploadForm" asp-controller="Home" method="Post"&gt;
      &lt;input type="submit" value="Add another file" class="btn btn-sm btn-primary" /&gt;
  &lt;/form&gt;
  &lt;form asp-action="Upload" asp-controller="Home" method="Post" enctype="multipart/form-data"&gt;
  
      @foreach (var item in Model.Upload)
      {
          @(await Html.PartialAsync("_UploadForm", item))
      }
  
      &lt;div class="col-xs-12"&gt;
          &lt;input type="submit" value="Upload" class="btn btn-sm btn-info" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically <code>AddUploadForm</code> action adds a new view model of type <code>FileInfo</code> to <code>Model.Upload</code> which is my main view model. 
  The problem is that the list <code>List&lt;FileInfo&gt; vm</code> in <code>Upload</code> action below is totally empty:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public IActionResult Upload(List&lt;FileInfo&gt; vm)
  {
      .... some other logic 
      return View();
  }
  </code></pre>
  
  <p>I don't want to use <code>multiple</code> attribute because I would like to force user to provide a title and description for every file.</p>
  
  <p>Any help is kindly appreciated!</p>