Apex
CloudFiles Client

Copy Salesforce Files

this function is used 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 global static void upload( list\<types uploadsalesforcefilepayload> files, string runas ) parameters files list of types uploadsalesforcefilepayload docid\ labgdiezehcymtmd0ile9 objects 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 return type this function doesn't return anything after the file is successfully copied, a platform event salesforce file copied docid\ m9v6ikaxwsmxifd5e7zwy is published you can use this event as trigger in the apex or flows to delete the salesforce file using delete sobject method example list\<cldfs types uploadsalesforcefilepayload> inputs = new list\<cldfs types uploadsalesforcefilepayload>{ new cldfs types uploadsalesforcefilepayload( '069do000000hwb8yai', 'sharepoint', '01pljoyloawjbfgbse7fhk5akosimdio6h', 'b!zfa15hrs1uy9ph3vw5tfjahfp1lrylzavdwlnhyyq8sa l6ejxb tjbmyuxi1qfl', null ) }; cldfs client upload(inputs,'integrationuser');