Skip to main content

Copy File

Copies a file from one location to another within pCloud.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The client identifier returned from the Login node.
  • Source Path - The full path to the file to be copied (e.g., "/Documents/report.pdf").
  • Target Path - The full path where the file will be copied to, including the new file name (e.g., "/Backup/report_copy.pdf").

How It Works

The Copy File node duplicates a file within pCloud without downloading or re-uploading it. When executed, the node:

  1. Validates the Client Id
  2. Validates and normalizes the source path
  3. Validates and normalizes the target path
  4. Retrieves the authenticated pCloud client
  5. Performs the server-side copy operation
  6. Returns success when the file is copied

Requirements

  • An active pCloud connection (Client Id from Login node)
  • Source file must exist in pCloud
  • Valid source and target paths
  • Appropriate permissions for both source and target locations
  • Sufficient storage space in pCloud

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Client Id
  • Empty source path
  • Empty target path
  • Source file does not exist
  • Target path is invalid
  • Insufficient permissions
  • Insufficient storage space
  • Network connectivity issues
  • Target file already exists (may be overwritten)

Usage Notes

  • The copy operation happens entirely on pCloud servers (no download/upload)
  • This is much faster than downloading and re-uploading files
  • Both source and target paths must include the file name
  • The target path can have a different file name
  • Paths are automatically normalized with leading "/"
  • If the target file exists, it will be overwritten
  • The original file remains unchanged

Path Format

Both source and target paths should include the complete file path:

  • Source: /folder/filename.ext
  • Target: /destination/newname.ext

The target path defines both the destination folder and the new file name.

Best Practices

  • Verify the source file exists before copying
  • Use meaningful target file names
  • Consider using timestamps in file names to avoid overwrites
  • For backup operations, organize copies in dedicated folders
  • Handle errors appropriately to ensure reliability
  • Use Continue On Error for bulk copy operations where some files may not exist

Example: Create Backup

Create a backup copy of an important file:

Inputs:

  • Client Id: (from Login node)
  • Source Path: "/Documents/contracts/agreement.pdf"
  • Target Path: "/Backup/contracts/agreement_backup.pdf"

The file is copied to the backup folder with a new name.

Example: Copy with Timestamp

Create a timestamped copy of a file:

Inputs:

  • Client Id: (from Login node)
  • Source Path: "/Reports/monthly_report.xlsx"
  • Target Path: "/Archive/monthly_report_2024_01_15.xlsx"

This creates a dated archive copy of the report.

Example: Duplicate for Processing

Copy a file before processing to preserve the original:

  1. Copy File - Copy original to processing folder
  2. Download - Download the copy
  3. Process - Process the downloaded file
  4. Upload - Upload processed version
  5. Original remains safe in its location

Common Automation Scenarios

Automated Backups:

  • Copy critical files to backup folders regularly
  • Create dated copies for version control
  • Maintain multiple backup versions

File Versioning:

  • Copy files before modifications
  • Create numbered or dated versions
  • Maintain history of changes

Distribution:

  • Copy files to multiple destination folders
  • Distribute reports to different departments
  • Create copies for different teams or clients

Archiving:

  • Copy old files to archive folders
  • Preserve original files while creating working copies
  • Organize historical data

Example: Batch Copy with Loop

Copy multiple files with a consistent pattern:

  1. Set Variable - Create array of file names
  2. For Each - Loop through files
  3. Copy File - Copy each file
    • Source: /Input/${fileName}
    • Target: /Archive/${fileName}_${date}

This creates archived copies of multiple files.

Example: Mirror Folder Structure

Copy files while maintaining organization:

For each file in a list:

  • Copy File - /Projects/Active/${filename} to /Projects/Completed/${filename}

This moves project files from active to completed while preserving names.

Troubleshooting

Source File Not Found:

  • Verify the source path is correct
  • Check if the file exists in pCloud
  • Ensure path uses forward slashes (/)
  • Verify spelling and case sensitivity

Copy Fails:

  • Check available storage space in pCloud
  • Verify permissions on source and target locations
  • Ensure target folder exists
  • Check internet connectivity

Target File Issues:

  • If target already exists, it will be overwritten
  • Ensure target folder is writable
  • Verify target path format is correct

Invalid Client ID:

  • Ensure Login node executed successfully
  • Verify Client Id is being passed correctly
  • Check if connection is still active