title: How to delete a file from App_Data folder in asp.net mvc 3 application?
body: <p>I read an excel file from the user using </p>
  
  <pre><code> &lt;input type="file" name="file" /&gt;
  </code></pre>
  
  <p>send it to the controller and store it in App_Data folder. I read that file. After I am done I wish to delete the file from App_Data folder. How do I do that?
  This is how I store it.</p>
  
  <pre><code>    public ActionResult importFile1(HttpPostedFileBase file)
      {
  
          if (file != null &amp;&amp; file.ContentLength &gt; 0)
          {
              // extract only the fielname
              var fileName = Path.GetFileName(file.FileName);
              // store the file inside ~/App_Data/uploads folder
              var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
              file.SaveAs(path);
          }
      }
  </code></pre>