title: Upload image and save in database in asp.net mvc3
body: <p>I want to add the ability to upload an image and save it in my database. I have a table and one of its columns is an Image data type. I followed <a href="http://forums.asp.net/t/1679447.aspx/1" rel="nofollow">this link</a>, and some similar links, but it doesn't seem to work. Here is the code I tried:</p>
  
  <pre><code>if (Request.Files.Count &gt; 0 &amp;&amp; Request.Files[0] != null)
  {
      HttpPostedFileBase file = Request.Files[0];
      var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), file.FileName);
      file.SaveAs(path);
  }
  </code></pre>
  
  <p>But the file doesn't save in the specified folder.</p>