SPFile.MoveTo Method (String, SPMoveOperations, Boolean)
Moves the file to the specified destination URL.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Available in SharePoint Online
Syntax
'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)> _
Public Sub MoveTo ( _
newUrl As String, _
flags As SPMoveOperations, _
requireWebFilePermission As Boolean _
)
'Usage
Dim instance As SPFile
Dim newUrl As String
Dim flags As SPMoveOperations
Dim requireWebFilePermission As Boolean
instance.MoveTo(newUrl, flags, requireWebFilePermission)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)]
public void MoveTo(
string newUrl,
SPMoveOperations flags,
bool requireWebFilePermission
)
Parameters
newUrl
Type: System.StringSpecifies the destination URL.
flags
Type: Microsoft.SharePoint.SPMoveOperationsSpecifies the kind of move operation. Must be MoveOperations.Overwrite or MoveOperations.AllowBrokenThickets.
requireWebFilePermission
Type: System.BooleanWhether the move operation requires the Add and Customize Web Pages permission when the extension of the moved file has been changed and the extension of the destination URL belongs to WebFileExtensions of the web application. The default value is true.