Apex
CloudFiles Client
Copy Salesforce Files
Use this function to copy Salesforce files to external storage. This function queue the files to be copied to externals torage. The queue is processed at a dynamic rate based on external library. For example, for SharePoint, the queue is processed at 70 files per minute
Please note, this function doesn't put any limit on the size of files. You can use it to copy files of any size, without worrying about apex governor limits
- runAs - Email Id of the user on whom behalf the function should run. If you want to run the action as automation user, supply integrationUser
This function doesn't return anything
After the file is successfully copied, a platform event Salesforce File Copied is published. You can use this event as trigger in the apex or flows to delete the Salesforce file using delete Sobject method