SPFile.MoveTo method (String, SPMoveOperations)

Moves the file to the specified destination URL based on the type of operation that is specified.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public void MoveTo(
	string newUrl,
	SPMoveOperations flags
)

Parameters

newUrl
Type: System.String

A string that specifies the destination URL.

flags
Type: Microsoft.SharePoint.SPMoveOperations

An enumeration value that specifies the type of move operation; for example, whether to complete the operation when supporting files are absent, or whether to overwrite a file with the same name.

ExceptionCondition
ArgumentException

The value of the flags is not valid.

The flags can only be set to BypassApprovePermission, Overwrite, AllowBrokenThickets, or the result of a bitwise OR operation between them.

Show: