Click or drag to resize
ISharePointFileServiceUploadFile Method
Uploads the file's content specified as a stream to the serverRelativeUrl location.

Namespace: CMS.SharePoint
Assembly: CMS.SharePoint (in CMS.SharePoint.dll) Version: 10.0.0
Syntax
C#
void UploadFile(
	string serverRelativeUrl,
	Stream stream,
	bool overwriteExisting
)

Parameters

serverRelativeUrl
Type: SystemString
Server relative URL of the file.
stream
Type: System.IOStream
Stream with the file content.
overwriteExisting
Type: SystemBoolean
If true, an existing file will be overwritten when it already exists.
Exceptions
ExceptionCondition
SharePointFileAlreadyExistsExceptionThrown when trying to upload to serverRelativeUrl location which already exists and overwriteExisting is set to false.
ArgumentExceptionThrown when trying to upload to serverRelativeUrl location which already exists, overwriteExisting is set to true, but the location can not be overwritten.
ArgumentNullExceptionThrown when serverRelativeUrl is null.
ArgumentOutOfRangeExceptionThrown when serverRelativeUrl is in invalid format.
SharePointConnectionNotSupportedExceptionThrown when given connectionData contains unsupported authentication mode or invalid URL.
WebExceptionThrown when error related to network or protocol occurs.
ExceptionThrown in case of unexpected error condition.
See Also