title: Could not find a part of the path: Server.mapPath
body: <p>I'm trying to save a banner picture and before saving to a folder I'm checking and creating the respective folder as well but it gives me error even though I checked that the folder exists. Here is the code:</p>
  
  <pre><code>HttpPostedFileBase banner = Request.Files["banner"];
  if (banner != null &amp;&amp; banner.ContentLength &gt; 0) {
      var folder = Server.MapPath("~/images/Continents/");
      if (!Directory.Exists(folder)) {
          Directory.CreateDirectory(folder);
      }
      banner.SaveAs(Server.MapPath("~/images/Continents/" + image.FileName));
      string x = "/images/Continents/" + image.FileName;
      continent.BANNER = x;
  }
  </code></pre>
  
  <p>Is there something I'm missing?</p>