title: MVC HttpPostedFileBase always null
body: <p>I have this controller and what I am trying to do is to send an image to the controller as a [byte], this is my controller: </p>
  
  <pre><code>[HttpPost]
  public ActionResult AddEquipment(Product product, HttpPostedFileBase image) 
   {
  
              if (image != null) 
              {
                  product.ImageMimeType = image.ContentType;
                  product.ImageData = new byte[image.ContentLength];
                  image.InputStream.Read(product.ImageData, 0, image.ContentLength);
              }
  
              _db.Products.Add(product);
              _db.SaveChanges();
  
              return View();
   }
  </code></pre>
  
  <p>and on my view:</p>
  
  <pre><code>@using (Html.BeginForm("AddEquipment", "Equipment", FormMethod.Post)) {
  
      &lt;fieldset&gt;
          &lt;legend&gt;Product&lt;/legend&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Name)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Name)
              @Html.ValidationMessageFor(model =&gt; model.Name)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Description)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Description)
              @Html.ValidationMessageFor(model =&gt; model.Description)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Price)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Price)
              @Html.ValidationMessageFor(model =&gt; model.Price)
          &lt;/div&gt;
  
          &lt;div class="editor-label"&gt;
              @Html.LabelFor(model =&gt; model.Category)
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;
              @Html.EditorFor(model =&gt; model.Category)
              @Html.ValidationMessageFor(model =&gt; model.Category)
          &lt;/div&gt;
  
          &lt;div&gt;
          &lt;div&gt;IMAGE&lt;/div&gt;
          &lt;input type="file" name="image" /&gt;
  
          &lt;/div&gt;
  
  
          &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p>but the problem is that on my controller the value for image is alway null, I cant seem to get any information on the HttpPostedFileBase</p>