title: C# generic handler not getting data from post
body: <p>I'm doing a simple c# generic handler that should receive a form post. Here's the form...</p>
  
  <pre><code>&lt;form id="frmUploadImage" action="../Handlers/LocalImageUploadHandler.ashx" method="post" style="display: none"&gt;
      &lt;div&gt;
          &lt;input style="display: none; margin-bottom: 20px" type="file" id="uploadImage" /&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have some code that, upon the click of a button invokes the click event of the input. When the input is loaded, the following is invoked (I can set a breakpoint and it gets here).</p>
  
  <pre><code>var jqxhr = $.post('../Handlers/LocalImageUploadHandler.ashx', $('#frmUploadImage').serialize())
              .success(function() {
                  alert('worked');
              })
              .error(function() {
                  alert('failed');
              });
  </code></pre>
  
  <p>It will show an alert for "failed". Server-side, it is calling this in the handler (I can verify that it is getting invoked by setting a breakpoint).</p>
  
  <pre><code>public void ProcessRequest(HttpContext context)
      {
          context.Response.ContentType = "application/octet-stream";
          var file = Convert.FromBase64String(context.Request.Form["uploadedFile"]);
  //other stuff
  }
  </code></pre>
  
  <p>What's interesting is that the context.Request.Form and context.Request.Files properties have no items in them, even though they are being sent. Nothing I've done has worked. I've tried posting with XHR, jQuery, etc. I've tried pulling the data out of the file upload control as a DataUrl and serializing it to a base64 encoded string and putting it in an ajax call. The handler will receive a post, but the data is being stripped.</p>