title: How to upload a image and display on same page in asp.net mvc 4
body: <p>i have developed a web application using asp.net <strong>mvc4</strong> and <strong>razor</strong> syntax.
  i need to upload an image using file uploader and display in the same page with details of the image.</p>
  
  <p>as an example there's a <code>"file uploader"</code> and <code>"submit button"</code> in <code>"contact page"</code> of my application. when i upload an image of a person and <code>click</code> the submit button, it should display the image somewhere in the page with its details like image name, size like that. </p>
  
  <p>is there any possible way to achieve that? </p>
  
  <p>here is the code for my controller class</p>
  
  <pre><code>public class FileUploadController : Controller
      {
          //
          // GET: /FileUpload/
  
          public ActionResult Index()
          {
              return View();
          }
          public ActionResult FileUpload()
          {
              return View();
          }
  
          [AcceptVerbs(HttpVerbs.Post)]
          public ActionResult FileUpload(HttpPostedFileBase uploadFile)
          {
              if (uploadFile.ContentLength &gt; 0)
              {
                  string filePath = Path.Combine(HttpContext.Server.MapPath("~/Img/"),
                                                 Path.GetFileName(uploadFile.FileName));
              }
              return View();
          }
      }
  </code></pre>
  
  <p>and here is the code for view</p>
  
  <pre><code>&lt;h2&gt;FileUpload&lt;/h2&gt;
  
       @(Html.BeginForm("FileUpload", "FileUpload",FormMethod.Post, new { enctype = "multipart/form-data" }))
          &lt;input name="uploadFile" type="file" /&gt;
          &lt;input type="submit" value="Upload File" /&gt;
  </code></pre>
  
  <p>but how to display on page?</p>
  
  <p>please help.</p>