Reputation: 2327
I have one function which uses SearchExecutor
finds to find the path of a specified file, which returns a string like.
https://example.sharepoint.com/sites/DevelopementTestingSite/Shared Documents/Forms/DispForm.aspx?ID=43
I have another function which creates and returns a Microsoft.SharePoint.Client.Folder
.
Give:
How can I copy the file to the folder?
If it helps, the ServerRelativePath has been initialized on the Folder with:
Folder itemFolder = folderItem.Folder;
context.Load(itemFolder, folder => folder.ServerRelativePath);
context.ExecuteQuery();
return itemFolder;
Upvotes: 0
Views: 1800
Reputation: 1889
You can use CSOM File.CopyTo
method or File.CopyToUsingPath
method to copy a file to another location.
It's easy to get the file instance via the file location info.
BR
Upvotes: 1