Code Snippets: Upload and Download a file from Sharepoint Document Library

Here are sample code snippets to upload and download a file from Sharepoint Document Library Upload a File: 1: public static void UploadDocument(string siteCollectionUrl, 2: string siteUrl,string libraryName) 3: { 4: using (SPSite hostSite = new SPSite(siteCollectionUrl)) 5: { 6: #region Reading a file 7:  8: string filename = “C:\TFS.doc”; 9: FileInfo fInfo = new […]