title: Web API: how to access multipart form values when using MultipartMemoryStreamProvider?
body: <p>I used to use <code>MultipartFormDataStreamProvider</code> to process multipart requests. </p>
  
  <p>Since I want the uploaded file to be stored in memory, instead of a disk file, I've changed my code to use <code>MultipartMemoryStreamProvider</code>. The file loading seems to be working fine but I am no longer able to access
  other form values which were available through <code>provider.FormData</code> under <code>MultipartFormDataStreamProvider</code>. Could someone show me how to do this?</p>
  
  <p>The raw request captured by Fiddler:</p>
  
  <pre><code>POST http://myserver.com/QCCSvcHost/MIME/RealtimeTrans/ HTTP/1.1
  Content-Type: multipart/form-data; boundary="XbCY"
  Host: na-w-lxu3
  Content-Length: 1470
  Expect: 100-continue
  Connection: Keep-Alive
  
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=PayloadType
  
  X12_270_Request_005010X279A1
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=ProcessingMode
  
  RealTime
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=PayloadID
  
  e51d4fae-7dec-11d0-a765-00a0c91e6fa6
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=TimeStamp
  
  2007-08-30T10:20:34Z
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=SenderID
  
  HospitalA
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=ReceiverID
  
  PayerB
  --XbCY
  Content-Type: text/plain; charset=utf-8
  Content-Disposition: form-data; name=CORERuleVersion
  
  2.2.0
  --XbCY
  Content-Disposition: form-data; name=Payload; filename=276_5010.edi
  
  ISA*00*~SE*16*0001~GE*1*1~IEA*1*191543498~
  --XbCY--
  </code></pre>
  
  <p>My controller code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>string payload = null;
  NameValueCollection nvc = null;
  string fname = null;
  StringBuilder sb = new StringBuilder();
  sb.AppendLine();
  foreach (StreamContent item in provider.Contents)
  {
      fname = item.Headers.ContentDisposition.FileName;
      if (!String.IsNullOrWhiteSpace(fname))
      {
          payload = item.ReadAsStringAsync().Result;
      }
      else
      {
          nvc = item.ReadAsFormDataAsync().Result;
      }
  }
  </code></pre>