title: Get the byte array of uploaded file on web Api project
body: <p>I'm working on an Android App which communicates with a WebApi .NET project in order to insert and get date from database, common case. 
  I've tried to use Multipart MIME. So I've used the following code:</p>
  
  <pre><code>public async Task&lt;HttpResponseMessage&gt; ManageProfilePicture()
      {
          if (!Request.Content.IsMimeMultipartContent())
          {
              throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
          }
          string root = HttpContext.Current.Server.MapPath("~/App_Data");
          var provider = new MultipartFormDataStreamProvider(root);
  
          var task = await Request.Content.ReadAsMultipartAsync(provider).
              ContinueWith&lt;HttpResponseMessage&gt;(t =&gt;
              {
                  if (t.IsFaulted || t.IsCanceled)
                  {
                      Request.CreateErrorResponse(HttpStatusCode.InternalServerError, t.Exception);
                  }
  
                  String fileName = provider.FileData[0].Headers.ContentDisposition.FileName;
                  return Request.CreateResponse(HttpStatusCode.OK);
              });
  
          return task;
      }
  </code></pre>
  
  <p>I'm able to get the file name and other informations about the uploaded file. How could I get the byte array associated to the uploaded file in order to save it in MS SQL Server ? Maybe it's better to recreate the picture in a accessable folder than store it in the database...</p>
  
  <p>Someone could help me with that ? </p>