title: How to post a file to a variable (with type 'HttpPostedFileBase' ) in controller
body: <p>I have a variable with <code>HttpPostedFileBase</code> as <strong>type</strong> in my model. The model is given below:</p>
  
  <pre><code>    public class MailModel
      {
          public int mail_id { get; set; }
          public string From { get; set; }
          public string To { get; set; }
          public string subject { get; set; }
          public string Content { get; set; }
          public HttpPostedFileBase file { get; set; }
  
      }
  </code></pre>
  
  <p>Now I want to assign a value to the variable <code>file</code>  from my <strong>local</strong> <strong>file path</strong>. How can I assign a value to <code>file</code> in the corresponding controller?</p>
  
  <pre><code>    public class MailController : Controller
      {
         MailModel mm = new MailModel();
         mm.file = ?            //Can I add a filepath?
      }
  </code></pre>
  
  <p>Thank you!</p>