public void DownloadFileFromLibrary(string siteUrl, string webName, string libraryName, string subfolderPath, string fileName, string downloadPath) { using (ClientContext clientContext = new ClientContext(siteUrl)) { string filePath = string.Empty; if (!string.IsNullOrEmpty(subfolderPath)) { filePath = string.Format("/{0}/{1}/{2}/{3}", webName, libraryName, subfolderPath, fileName); } else { filePath = string.Format("/{0}/{1}/{2}", webName, subfolderPath, fileName); } var fileInformation = File.OpenBinaryDirect(clientContext, filePath); var stream = fileInformation.Stream; IList<byte> content = new List<byte>(); int b; while ((b = fileInformation.Stream.ReadByte()) != -1) { content.Add((byte)b); } var downloadFileName = Path.Combine(downloadPath, fileName); System.IO.File.WriteAllBytes(downloadFileName, content.ToArray()); fileInformation.Stream.Close(); } }
All the question that scared me now i am trying to scare them .. so that they cant scare others :)
Tuesday, November 8, 2011
Download File From Library
Subscribe to:
Post Comments (Atom)
Featured Posts
เคिเคธเคे เคนिเคธ्เคธे เคฎें เคฎें เคฏे เคงเคฐเคคी
เคिเคก़िเคฏों เคा เคเคฐ เคเคฒ เคฐเคนा เคนै เคंเคธाเคจ เคुเคถ เคนै เคि เคฏे เคเค เคฆूเคฐ เคนै เค เคญी เคเคญी เคคो เคเคเคी เคเคฐ เคคเค เคคेเคฐा เคญी เคเคฐ เคเคฒेเคा เคเคญी เคฌेเคुเคฌाเคจ เคนै เคुเค เคฌोเคฒเคคे เคจเคนीं เคนै เคฆिเคฒ เคฎें เคฆुเค ...
-
public struct CoOrds { public int x, y; public CoOrds( int p1, int p2) { x = p1; y = p2; } }
-
Use the following function which is built in percentile(BIGINT col, p) and set p to be 0.5 and will calculate the median credit : ...
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......