Skip to main content

Delete File

Permanently deletes a file from 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.
  • Path - The full path to the file to be deleted (e.g., "/Documents/old_file.pdf").

How It Works

The Delete File node permanently removes a file from pCloud. When executed, the node:

  1. Validates the Client Id
  2. Validates the path is not empty
  3. Normalizes the path by adding a leading "/" if needed
  4. Retrieves the authenticated pCloud client
  5. Deletes the file at the specified path
  6. Returns success when the file is deleted
warning

This operation is permanent. Deleted files cannot be recovered unless pCloud's trash/recycle bin feature retains them temporarily. Always verify the path before deleting.

Requirements

  • An active pCloud connection (Client Id from Login node)
  • File must exist at the specified path
  • Appropriate permissions to delete the file
  • Valid file path

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Client Id
  • Empty path
  • File does not exist at the specified path
  • Insufficient permissions to delete the file
  • Path points to a folder instead of a file
  • Network connectivity issues

Usage Notes

  • Deletion is permanent - use with caution
  • The path must point to a file, not a folder
  • Paths are automatically normalized with leading "/"
  • Use "/" as the path separator
  • File names are case-sensitive
  • There is no confirmation dialog - deletion happens immediately
  • Consider using Copy File before Delete File for backup

Path Format Examples

The Path input should specify the complete file path:

  • "/Documents/report.pdf" - Deletes report.pdf from Documents
  • "temp/data.json" - Deletes data.json from temp (path becomes /temp/data.json)
  • "/Archive/old_backup.zip" - Deletes old_backup.zip from Archive

Best Practices

  • Always verify the file path before deletion
  • Consider creating backups before deleting important files
  • Use meaningful error handling for critical deletion operations
  • For bulk deletions, use Continue On Error to handle missing files gracefully
  • Log deleted files for audit trails
  • Implement confirmation logic in critical workflows
  • Test deletion logic with non-critical files first

Example: Delete Temporary File

Delete a temporary file after processing:

Inputs:

  • Client Id: (from Login node)
  • Path: "/Temp/processing_temp.dat"

This removes the temporary file after use.

Example: Clean Up Old Files

Delete an outdated report:

Inputs:

  • Client Id: (from Login node)
  • Path: "/Reports/2023/January/old_report.xlsx"

This removes an obsolete report from the archive.

Example: File Processing Cleanup

Process and clean up workflow:

  1. Download - Download file from pCloud
  2. Process - Process the file locally
  3. Upload - Upload results to pCloud
  4. Delete File - Remove the original file
  5. Original is replaced with processed version

Common Automation Scenarios

Temporary File Cleanup:

  • Delete files after processing is complete
  • Remove temporary working files
  • Clean up intermediate processing results

Automated Maintenance:

  • Delete old log files
  • Remove outdated reports
  • Clean up expired temporary files
  • Delete processed items after archiving

Space Management:

  • Delete files after successful backup
  • Remove duplicates
  • Clean up old versions
  • Free up storage space

Workflow Cleanup:

  • Delete input files after successful processing
  • Remove error files after correction
  • Clean up testing data

Example: Conditional Deletion

Delete files based on conditions:

  1. List Files - Get file list from folder
  2. For Each - Loop through files
  3. Get File Date - Check file age
  4. Decision - If older than 30 days
  5. Delete File - Delete old file

This removes files older than a specified age.

Example: Bulk Deletion

Delete multiple files with error handling:

  1. Set Variable - Create array of file paths
  2. For Each - Loop through files
  3. Delete File (Continue On Error: true)
    • Path: ${filePath}
  4. Log - Record deletion results

This handles missing files gracefully during bulk operations.

Safety Considerations

caution

Before implementing automated deletion:

  • Test thoroughly with non-critical files
  • Implement proper error handling
  • Consider adding confirmation steps
  • Log all deletions for audit purposes
  • Verify paths are correct before execution
  • Consider archiving instead of deleting

Troubleshooting

File Not Found:

  • Verify the file path is correct
  • Check if the file still exists
  • Ensure path uses forward slashes (/)
  • Verify spelling and case sensitivity
  • File may have been already deleted

Permission Denied:

  • Check if you have delete permissions
  • Verify the Login was successful
  • Ensure you're authenticated with correct credentials
  • Some system files may be protected

Path Points to Folder:

  • Use Delete Folder node for folders
  • Verify the path points to a file
  • Check for trailing slashes

Invalid Client ID:

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

Alternative: Archive Instead of Delete

For safer operations, consider archiving instead of deleting:

  1. Copy File - Copy to archive folder
  2. Verify Copy - Confirm copy succeeded
  3. Delete File - Delete original

This ensures you have a backup before permanent deletion.