Click or drag to resize
SharePointFileInfoProviderUpdateFile Method
Updates file in SharePoint library with new content and name. The newFileName can be the same as the old one. The updated 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: 9.0.0
Syntax
C#
public static void UpdateFile(
	SharePointFileInfo fileInfo,
	Stream contentStream,
	string newFileName
)

Parameters

fileInfo
Type: CMS.SharePointSharePointFileInfo
SharePoint file to be updated.
contentStream
Type: CMS.IOStream
Stream containing the new file's binary content.
newFileName
Type: SystemString
File name of the updated file.
Exceptions
ExceptionCondition
SharePointFileAlreadyExistsExceptionThrown when newFileName identifies an already existing file within the library.
FileNotFoundExceptionThrown when file identified by fileInfo does not exist on SharePoint server.
SharePointConnectionNotFoundExceptionThrown when the SharePoint library has no valid connection defined.
ExceptionThrown in case of unexpected error condition.
See Also