title: dropzone and asp.net core 3.1 - whats the proper param to be sent to controller?
body: <p>i have this in my razor view:</p>
  
  <pre><code>&lt;div id="dropzone"&gt;
  &lt;form action="/Controller/Upload" method="post" enctype="multipart/form-data"
        id="my-awesome-dropzone" class="dropzone needsclick dz-clickable dropzone-previews"&gt;
      @Html.AntiForgeryToken()
      &lt;div &gt;&lt;/div&gt;
      &lt;div class="dz-message needsclick"&gt;
          &lt;button type="button" class="dz-button"&gt;Drop files here or click to upload.&lt;/button&gt;&lt;br /&gt;
      &lt;/div&gt;
      &lt;span class="note needsclick"&gt;
  
      &lt;/span&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p></p>
  
  <p>and this in my js:</p>
  
  <pre><code>Dropzone.options.myAwesomeDropzone = {
    paramName: "file", // The name that will be used to transfer the file
    maxFiles: mediaMax,
    maxFilesize: maxSize,
    uploadMultiple: true,
    accept: function (file, done) {
      if (file.name === "justinbieber.jpg") {
          done("Naha, you don't.");
      }
      else { done(); }
  },
    init: function () {
      this.on("sending", function (file, response, formData) {
          formData["__RequestAntiForgeryToken"] = document.getElementsByName("__RequestVerificationToken")[1].value;
      });
      this.on("sendingmultiple", function (file, response, formData) {
          formData["__RequestAntiForgeryToken"] = document.getElementsByName("__RequestVerificationToken")[1].value;
      });
      this.on("success", function (file, response) {
          file.serverID = response.id;
      });
      this.on("error", function (file, response) {
          var r = response;
          console.log("Drop Err:");
          console.log(r);
      });
  }};
  </code></pre>
  
  <p>in my controller i have tried this:</p>
  
  <pre><code>    [HttpPost]
      [FormAttributes.DisableFormValueModelBinding]
      [ValidateAntiForgeryToken]
      public async Task&lt;IActionResult&gt; Upload(ICollection&lt;IFormFile&gt; files)
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>        [HttpPost]
      [FormAttributes.DisableFormValueModelBinding]
      [ValidateAntiForgeryToken]
      public async Task&lt;IActionResult&gt; Upload(IFormFile file)
  </code></pre>
  
  <p>both file and files return 0 or null</p>
  
  <p>the only that works is </p>
  
  <pre><code>    [HttpPost]
      [FormAttributes.DisableFormValueModelBinding]
      [ValidateAntiForgeryToken]
      public async Task&lt;IActionResult&gt; Upload(ICollection&lt;IFormFile&gt; files)
      {
          if (ModelState.IsValid)
          {
  
              var more = HttpContext.Request.Form.Files;
              ... do stuff
          } }
  </code></pre>
  
  <p>where i basically ignore the input param of files<Br>
  can anyone tell me what the proper parameters for Upload is?</p>
  
  <p>for ref i looked at the following links:<br>
  <a href="https://stackoverflow.com/questions/29836342/mvc-6-httppostedfilebase">MVC 6 HttpPostedFileBase?</a><br>
  <a href="https://dotnetthoughts.net/uploading-images-aspnet-core-and-dropzone/" rel="nofollow noreferrer">https://dotnetthoughts.net/uploading-images-aspnet-core-and-dropzone/</a></p>