title: Passing File path to MVC controller from View with Ajax J query return null
body: <p>I'm trying to upload a image using MVC 5 and Ajax Jquery (asynchronously) but value of image variable always return null,</p>
  
  <p>i already checked some previous stack overflow posts regarding this issue but i could not find my mistake, can anyone help me,</p>
  
  <p>please help,,</p>
  
  <p><strong>Model Class</strong></p>
  
  <pre><code> public class TravelCategoryCustom
          {
              public int categoryId { get; set; }
              public string categoryName { get; set; }
              public string categoryDescriprion { get; set; }
              public HttpPostedFileBase image { get; set; }
              public int TotalPlaces { get; set; }
          }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;form enctype="multipart/form-data"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label&gt;Category Name&lt;/label&gt;
                      @Html.TextBoxFor(model =&gt; model.categoryName, new { @class = "form-control" })
  
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label&gt;Category Description&lt;/label&gt;
                      @Html.TextAreaFor(model =&gt; model.categoryDescriprion, 5, 1, new { @class = "form-control " })
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label&gt;Category Image&lt;/label&gt;
                       &lt;input type="file" id="dialog" /&gt;
                  &lt;/div&gt;
  
                  &lt;input type="button" value="Create" id="submtt" class="btn btn-primary" onclick="favfunct()" /&gt;
  
              &lt;/form&gt;   
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>&lt;script&gt;
      function favfunct() {
      $.ajax({
    var formData = new FormData($('form')[0]);
          url: "/MVCTravelCategories/Create",
          dataType: "json",
          type: "POST",
          contentType: 'application/json; charset=utf-8',
          data: JSON.stringify({ trvlcategory: { categoryId: '1', categoryName: 'testName', categoryDescriprion: 'TestDec', image: formData , TotalPlaces: '3' } }),
          async: true,
          processData: false,
          cache: false,
          success: function (data) {
              alert(data);
          },
          error: function (xhr) {
              alert('error');
          }
      });
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Action Result
  (image)
  <a href="http://ishara119-001-site1.myasp.net/content/Untitled.jpg" rel="nofollow">http://ishara119-001-site1.myasp.net/content/Untitled.jpg</a></p>