Yes, you can download the file from sharepoint. When you have a URL for a document, it can be downloaded using HttpWebRequest and HttpWebResponse.
with example code
DownLoadDocument(string strURL, string strFileName) { HttpWebRequest request; HttpWebResponse response = null; request = (HttpWebRequest)WebRequest.Create(strURL); request.Credentials = System.Net.CredentialCache.DefaultCredentials; request.Timeout = 10000; request.AllowWriteStreamBuffering = false; response = (HttpWebResponse)request.GetResponse(); Stream s = response.GetResponseStream(); // Write to disk if (!Directory.Exists(myDownLoads)) { Directory.CreateDirectory(myDownLoads); } string aFilePath = myDownLoads + "\\" + strFileName; FileStream fs = new FileStream(aFilePath, FileMode.Create); byte[] read = new byte[256]; int count = s.Read(read, 0, read.Length); while (count > 0) { fs.Write(read, 0, count); count = s.Read(read, 0, read.Length); } // Close everything fs.Close(); s.Close(); response.Close(); }
You can also use the GetItem API for the copy service to download the file.
string aFileUrl = mySiteUrl + strFileName; Copy aCopyService = new Copy(); aCopyService.UseDefaultCredentials = true; byte[] aFileContents = null; FieldInformation[] aFieldInfo; aCopyService.GetItem(aFileUrl, out aFieldInfo, out aFileContents);
A file can be obtained as an array of bytes.
source share