[英]In C# with CSOM, How can I copy a file from a known location to a known Folder?
我有一个函数,它使用SearchExecutor
finds 来查找指定文件的路径,它返回一个类似的字符串。
https://example.sharepoint.com/sites/DevelopementTestingSite/Shared Documents/Forms/DispForm.aspx?ID=43
我有另一个创建并返回Microsoft.SharePoint.Client.Folder
函数。
给:
如何将文件复制到文件夹?
如果有帮助,则 ServerRelativePath 已在文件夹上初始化为:
Folder itemFolder = folderItem.Folder;
context.Load(itemFolder, folder => folder.ServerRelativePath);
context.ExecuteQuery();
return itemFolder;
您可以使用 CSOM File.CopyTo
方法或File.CopyToUsingPath
方法将文件复制到另一个位置。
通过文件位置信息很容易获取文件实例。
BR
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.