title: asp.net File.OpenText can't read uploaded file
body: <p>I have an ASP.NET MVC application on Windows Server 2008. </p>
  
  <p>I need to upload a file, save it to an archive folder under the App_Data folder, then open and read from it. I can do this on my local machine but can't on the test server. I suspect it is a permissions issue but the permissions appear to be in place.  The relevant C# code:</p>
  
  <pre><code>HttpPostedFileBase hpf = Request.Files[0];
  var fileLength = hpf.ContentLength;
  if (fileLength != 0)
  {
      var archiveFolder = Server.MapPath("~/" + folder);
      var archiveFile = "import_" + DateTime.Now.ToString("yyyyMMdd_HHmm") + ".txt";
      var archivePath = Path.Combine(archiveFolder, archiveFile);
      hpf.SaveAs(archivePath);
  }
  </code></pre>
  
  <p>The above code saves the file fine.</p>
  
  <pre><code>StreamReader sr = File.OpenText(archivePath);
  </code></pre>
  
  <p>The above line throws an error:</p>
  
  <blockquote>
    <p>Could not find file 'c:\windows\system32\inetsrv\usb01312012.txt'.</p>
  </blockquote>
  
  <p>So although "archivePath" is a path to a saved file under App_Data, ASP.NET looks to the SYSTEM folder for the file.  </p>
  
  <p>I have given every permission except Full Control to IIS_USRS on the entire website. Why can't I access the file?</p>