SharePoint 2016 (Preview) has the Copy / Move files or folders api using CSOM and JSOM.
The SP.js contains the following api's,
- SP.MoveCopyUtil.copyFile
- SP.MoveCopyUtil.copyFolder
- SP.MoveCopyUtil.moveFile
- SP.MoveCopyUtil.moveFolder
Each of the method takes 3 parameters,
- context - current context
- source url - Full source url of the file / folder.
- destination url - Full destination url of the file / folder.
SP.MoveCopyUtil.copyFile: This copies the specified file to the destination url.
|
var context = SP.ClientContext.get_current(); |
The above code copies the /sitepages/home.aspx file to sitepages/home1.aspx with all the metadata including createdtime, author etc.
SP.MoveCopyUtil.copyFolder: Copies the specified folder to the destination url including the files within it.
|
var context = SP.ClientContext.get_current(); |
SP.MoveCopyUtil.moveFolder: Moves the specified folder to the destination.
|
var context = SP.ClientContext.get_current(); |
SP.MoveCopyUtil.moveFile: Moves the specified file to the destination url.
|
var context = SP.ClientContext.get_current(); |
The equivalent CSOM api is also available within the Microsoft.SharePoint.Client.MoveCopyUtil. The above api's are also available within O365.
by Balamurugan Kailasam via Everyone's Blog Posts - SharePoint Community
HI,
ReplyDeleteI am getting size limit error when trying to move file >= 100 mb in office365