Copy File
A Copy File node copies each incoming file to one or more destinations and does not change the original. Use it to deliver a file to a partner's folder while keeping your copy, to archive files into dated folders, or to distribute one upload to several teams or systems in a single node.
Copy File accepts file items, and it accepts data items by writing each one to a .json file first, so the result of a Transform node can be copied into a folder as a file. Destinations can be folders on your site, on a Remote Server, or in a Child Site.
Settings
Each destination has a Destination Type, Copy to a specific folder or Copy relative to the Automation's source path, and a Destination Folder Path that accepts tokens and templates. A path that ends with / keeps each file's name and its folder structure below the trigger's folder path, and a path that does not end with / renames the file. A node can have several destinations, and each file produces one copy per destination.
Under Advanced Settings:
- Destination Path Replacement replaces exact text in the resolved destination path after templates and tokens are applied. Text to Find in Destination Path names the text and Replace With sets its replacement. Matching is case-sensitive.
- Overwrite the Existing Files with New Ones is off by default. If their names match but sizes are different replaces a file when a file of the same name and a different size is at the destination, and If both their names and sizes match replaces same-size files too. With overwriting off, a file that already exists at the destination is skipped, and the skip is recorded in run detail. An overwrite deletes the existing file first, so a destination on a Remote Server needs delete permission there.
- Flatten Folders writes every file directly in the destination folder instead of recreating the source folder structure below it.
- Exclude Pattern removes matching files from the items the node copies, using the same syntax as the trigger's Exclude Pattern.
- Ignore Locked Folders applies when a destination is inside a folder protected by the Lock Subfolders Folder Setting. It is off by default.
What the Next Node Receives
Copy File passes on the copies, one file item for each destination written, and not the original file. To use the original after the copy, connect the node before Copy File to the next node as well.
Errors
A file that no longer exists when the node runs fails with a not-found error, for example when another branch moved it first. Error Handling rules on the node determine what happens to a failed item.