Script to Move Files in Alfresco

339 Views Asked by At

In Alfresco users can use rules to move files. How do I programmatically move a file from one folder to another?

Do you have an example?

I am using Alfresco 7.0 Share/Community version

1

There are 1 best solutions below

3
On BEST ANSWER

Using Script :

var backupFolder = space.childByNamePath('testfolder');
if (backupFolder == null)
{
   backupFolder = space.createFolder('testfolder');
}

document.move(backupFolder );

Ref : https://hub.alfresco.com/t5/alfresco-content-services-hub/javascript-api-cookbook/ba-p/293260

https://docs.alfresco.com/content-services/6.1/develop/reference/repo-root-objects-ref/