title: How to Integrate Dropzone.js with ASP.NET Core MVC?
body: <p>I want to upload some documents in my database using an IFormFile. On client side I'm using Dropzone.js but it's not working properly. Whenever I hit Submit button it sends a null value in parameter.
  I Have two queries.
  1. How to send Document (image/PDF) to the action method.
  2. How to redesign (change style of) Dropzone.
  (if someone explain the flow of dropzone then it would be very useful)</p>
  
  <blockquote>
    <p>Here is my HTML Code</p>
  </blockquote>
  
  <pre><code>&lt;form asp-action="AddDocument" asp-controller="Transactions" method="post" enctype="multipart/form-data" class="dropzone dz-clickable form-horizontal form-bordered" id="dropzoneForm"&gt;
      &lt;div class="form-group form-actions"&gt;
          &lt;div class="col-md-9 col-md-offset-4"&gt;
              &lt;button type="submit" class="btn btn-sm btn-primary"&gt;&lt;i class="fa fa-floppy-o"&gt;&lt;/i&gt; Upload&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <blockquote>
    <p>JS Code:</p>
  </blockquote>
  
  <pre><code>$(function () {
              Dropzone.options.dropzoneForm = {
                  paramName: "DocumentPhotos", // The name that will be used to transfer the file
                  autoProcessQueue: false,
                  uploadMultiple: true,
                  parallelUploads: 100,
                  accept: function (file, done) {
                      done();
                  }
              };
          });
  </code></pre>
  
  <blockquote>
    <p>and here is my Server-Side language code:</p>
  </blockquote>
  
  <pre><code>        [HttpPost]
          public async Task&lt;IActionResult&gt; AddDocument(IEnumerable&lt;IFormFile&gt; DocumentPhotos)
          {
  
              if (DocumentPhotos!= null)
              {
                  TransactionViewModel viewModel = new TransactionViewModel();
                  var documentModel = viewModel.TransactionModel.TransactionDocuemnt;
                  foreach (var item in DocumentPhotos)
                  {
  
                      using (MemoryStream stream = new MemoryStream())
                      {
                          await item.CopyToAsync(stream);
                          documentModel.DocumentPhoto = stream.ToArray();
                      }
                      documentModel.DocumentName = item.FileName;
                      documentModel.SrNo = 1;
                      documentModel.SocietyRid = UserSessionState.ApplicationUser.SocietyRid;
                  }
              }
  
              return PartialView("TransactionDocumentForm", transactionViewModel);
          }
  </code></pre>
  
  <blockquote>
    <p>Scripts and CSS  used (all files are downloaded from Dropzone.js):</p>
  </blockquote>
  
  <pre><code>&lt;link rel="stylesheet" href="~/css/basic.css" /&gt;
  &lt;link rel="stylesheet" href="~/css/dropzone.css" /&gt;
  &lt;script type="text/javascript" src="~/js/dropzone.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="~/js/dropzone-amd-module.js"&gt;&lt;/script&gt;
  </code></pre>