RE: ASP:Upload control . Uploading into a SharePoint Document Library Subfolder and FILE NOT FOUND error
Two Issues, apparently unrelated.
I have subfolders like this /ApplicantDocuments/20 and /ApplicantDocuments/21 (where 20 and 21 are my subfolders and ApplicantDocuments is my library.
1. 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);
2. 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?
Just testing in test environment. Will tighten code once it works.
public void UploadDocumentToSite(string foldername, string documentFileName)
SPSite siteCollection = new SPSite("https://xxxxxx");
SPWeb web = siteCollection.OpenWeb();
//SPSite.AllowUnsafeUpdates = true;
//Web.AllowUnsafeUpdates = true;
string Lib = "ApplicantDocuments";
SPFolder destFolder = web.GetFolder(Lib);
View Complete Post