title: unable to configure Web API for content type multipart
body: <p>I am working on Web APIs - Web API 2. My basic need is to create an API to update the profile of the user. In this, the ios and android will send me the request in multipart/form-data. They will send me a few parameters with an image. But whenever I try to create the API, my model comes to be null every time.</p>
  <p>I have also added this line in WebApiConfig:</p>
  <pre class="lang-cs prettyprint-override"><code>config.Formatters.JsonFormatter.SupportedMediaTypes
                      .Add(new MediaTypeHeaderValue(&quot;multipart/form-data&quot;));
  </code></pre>
  <p>This is my class:</p>
  <pre class="lang-cs prettyprint-override"><code>public class UpdateProfileModel
  {
     public HttpPostedFileBase ProfileImage { get; set; }
     public string Name { get; set; }
  }
  </code></pre>
  <p>This is my controller:</p>
  <pre class="lang-cs prettyprint-override"><code>[Route(&quot;api/Account/UpdateProfile&quot;)]
  [HttpPost]
  public HttpResponseMessage UpdateProfile(UpdateProfileModel model)
  {
  }
  </code></pre>
  <p>I am even not getting parameter values in my Model. Am I doing something wrong?</p>
  <p>None of the answers related to this were helpful for me. It's about 3rd day and I have tried almost everything and every method. but I am unable to achieve it.</p>
  <p>Although I can use this but this as shown below but this doesn't seem to be a good approach. so I am avoiding it.</p>
  <pre class="lang-cs prettyprint-override"><code>var httpRequest = HttpContext.Current.Request;
  if (httpRequest.Form[&quot;ParameterName&quot;] != null)
  {
      var parameterName = httpRequest.Form[&quot;ParameterName&quot;];
  }
  </code></pre>
  <p>and for files I can do this:</p>
  <pre class="lang-cs prettyprint-override"><code>if (httpRequest.Files.Count &gt; 0)
  {
       //I can access my files here and save them
  }
  </code></pre>
  <p>Please help if you have any good approach for it Or Please explain to me why I am unable to get these values in the Model.</p>
  <p>Thanks a lot in Advance</p>