title: Request.Files always 0
body: <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
      &lt;form id="form1" runat="server" enctype="multipart/form-data"&gt;
     
     &lt;table id="tblAttachment"&gt;  &lt;/table&gt;
  
      &lt;input id="btnSubmit" type="button" value="button" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Dynamically inserting a FileUpload Control<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
          $(document).ready(function () {
              var MaxAttachment = 1;
              $("#tblAttachment").append('&lt;tr&gt;&lt;td&gt;&lt;input id=\"Attachment_' + MaxAttachment.toString() + '\" name=\"file\" type=\"file\" /&gt;&lt;br&gt;&lt;a class=\"MoreAttachment\"&gt;Additional Attachment&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;');
  
              $("#btnSubmit").on("click", UploadFile);
          });
  
           
      &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Sending Data to .ashx using Jquery<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> function UploadFile() {
                var kdata = new FormData();
  
                var i = 0;
                //run through each row
                $('#tblAttachment tr').each(function (i, row) {
  
                    var row = $(row);
  
                    var File = row.find('input[name*="file"]');
  
                    alert(File.val());
  
                    kdata.append('file-' + i.toString(), File);
                    i = i + 1;
  
                });
  
                sendFile("fUpload.ashx", kdata, function (datad) { 
                }, function () { alert("Error in Uploading File"); }, true);
  
                 
            }</code></pre>
  </div>
  </div>
  </p>
  
  <p>On .ashx Count always Zero ??<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public class fUpload : IHttpHandler
  {
      public void ProcessRequest(HttpContext context)
      {
          int k = context.Request.Files.Count;
          context.Response.Write(UploadMultipleFiles());
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Ajax Request<div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function sendFile(requestUrl, dataPayload, successfunc, errorfunc, synchronousMode) { 
      $.ajax({
          url: requestUrl,
          type: "POST",
          dataType: "json",
  
          contentType: false,
          processData: false,
          cache: false,
          async: synchronousMode,
          data: dataPayload,
          success: successfunc,
          error: errorfunc
      });
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Please Check .. where i m doing wrong </p>
  
  <p>form tag having enctype="multipart/form-data" and each fileUPload control have uniue id and name attribute too</p>
  
  <p>Thanks</p>