Click or drag to resize
SharePointFileInfoProvider.UploadFile Method
Uploads a new file to the specified SharePoint library. The newly uploaded file is immediately available both on the SharePoint server and locally in the library.

Namespace: CMS.SharePoint
Assembly: CMS.SharePoint (in CMS.SharePoint.dll) Version: 11.0.0
Syntax
C#
public static void UploadFile(
	SharePointLibraryInfo libraryInfo,
	Stream contentStream,
	string libraryRelativeUrl
)

Parameters

libraryInfo
Type: CMS.SharePoint.SharePointLibraryInfo
SharePoint library to which the file is uploaded.
contentStream
Type: System.IO.Stream
Stream containing binary data of the file.
libraryRelativeUrl
Type: System.String
Relative URL of the file within library (i.e. "myPicture.jpeg" uploads file to the root folder of the library).
Exceptions
ExceptionCondition
SharePointConnectionNotFoundExceptionThrown when the SharePoint library has no valid connection defined (is read-only).
SharePointFileAlreadyExistsExceptionThrown when libraryRelativeUrl already exists.
See Also