Obtains a stream that can be used to download an item from a SharePoint server.
sourceUri
The full URI for the source item in the SharePoint server. This value cannot be null (Nothing in VB). It must be the URI to a valid SharePoint item, for example http://server/Shared Documents/File.ext
.
A SharePointClientDownloadData object that contains the stream data.
You can use the SharePointClientDownloadData.Stream property of the returned object to get access to the stream containing the downloaded item data (buffer).
The SharePointClientDownloadData.ETag property will contain the SharePoint ETag that identifies a version of the file. This is obtained directly from SharePoint and is not used by SharePointClient.
In most cases, the stream is an HTTP stream and the Stream.CanSeek value will be set to false. Hence, you should read the data from the stream in a forward direction only and not make any assumption regarding the stream length as shown in the examples.
The SharePointClientDownloadData class implements the System.IDisposable interface. Follow the standard .NET dispose pattern when using the SharePointClientDownloadData class. For more information, refer to the System.IDisposable interface documentation in MSDN.
Note: You should not dispose of the object in the SharePointClientDownloadData.Stream property yourself, instead, the object will be disposed when you call dispose on the owner SharePointClientDownloadData.
This method will not return until the item is finished downloading. If an error occurs, this method will throw an exception.
To get the download stream asynchronously, use GetDownloadStreamAsync.
To download an item to a disk file, use DownloadFile or DownloadFileAsync.
To upload an item to SharePoint, use UploadFile, UploadFileAsync, UploadStream or UploadStreamAsync.
This example will get the stream for a document at the specified SharePoint and then get the image information using Leadtools.Codecs.RasterCodecs.
Products |
Support |
Feedback: GetDownloadStream Method - Leadtools.SharePoint.Client |
Introduction |
Help Version 19.0.2017.3.21
|