title: MultipartFormDataStreamProvider vs HttpContext.Current
body: <p>I am struggling to understand why would I want to use MultipartFormDataStreamProvider when I can get all the information using HttpContext.Current.</p>
  
  <p>It is much easier to do this:</p>
  
  <pre><code>var mydata = HttpContext.Current.Request.Form["mydata"];
  </code></pre>
  
  <p>than this:</p>
  
  <pre><code>string root = HttpContext.Current.Server.MapPath("~/somedir");
  var provider = new MultipartFormDataStreamProvider(root);
  
  this.Request.Content.ReadAsMultipartAsync(provider).ContinueWith(t =&gt;
  {
      var mydata = provider.Contents.First(c =&gt; c.Headers.ContentDisposition.Name == "\"mydata\"").ReadAsStringAsync().Result;
  });
  </code></pre>
  
  <p>PS - I am trying to build an ApiController to accept file uploads. I've read this article <a href="http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2">http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2</a>.</p>