title: How to upload a file to a document library given a HttpPostedFile
body: <p>I have a HttpPostedFile object and after the file gets uploaded locally onto the server, i want to move that temp file into a document library in sharepoint.  Here is my code:</p>
  
  <pre><code>private void UploadWholeFile(HttpContext context, List&lt;FilesStatus&gt; statuses) {
              for (int i = 0; i &lt; context.Request.Files.Count; i++) {
                  HttpPostedFile file = context.Request.Files[i];
                  file.SaveAs(ingestPath + Path.GetFileName(file.FileName));
                  string fileName = Path.GetFileName(file.FileName);
  }
  </code></pre>
  
  <p>Can anyone give me some example code for this?  I have found a tutorial for Streams, but not quite sure if it would work the same in my situation</p>