title: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error
body: <p>RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error</p>
  
  <p>Two Issues, apparently unrelated.</p>
  
  <p>I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library.</p>
  
  <ol>
  <li><p>The below function is erroring with file not found, but I confirmed I'm sending the fully qualify path (i.e c:\test.txt) to System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open);</p></li>
  <li><p>Even if it worked, looking at the code, I'm not using argument foldername.  I'm passing 20 to the argument. How can I make sure it uploads into subfolder 20 of ApplicantDocuments?</p></li>
  </ol>
  
  <p>The file is on my local client and I'm running Windows 7/ IE 8.</p>
  
  <p>Thank you. </p>
  
  <p>Just testing in test environment. Will tighten code once it works.</p>
  
  <p>[code]
  public void UploadDocumentToSite(string foldername, string documentFileName)
  {
       SPSite siteCollection = new SPSite("<a href="https://xxxxxx" rel="nofollow noreferrer">https://xxxxxx</a>");
       SPWeb web = siteCollection.OpenWeb();
       //SPSite.AllowUnsafeUpdates = true;
       //Web.AllowUnsafeUpdates = true;
       string Lib = "ApplicantDocuments";
       SPFolder destFolder = web.GetFolder(Lib);
       sendmail(documentFileName+" "+foldername);
       System.IO.FileStream content = System.IO.File.Open(documentFileName, System.IO.FileMode.Open);
       destFolder.Files.Add(documentFileName, content, true);
  }
  [/code]</p>