Basic FTP icon

Basic FTP

Implement the operations from the "basic-ftp" library

Overview

The Remove Directory operation of the Basic FTP node allows you to delete a directory from a remote FTP server. This is useful in scenarios where you need to automate the cleanup or management of folders on an FTP server, such as removing temporary directories after processing files, or maintaining a clean directory structure.

Practical examples:

  • Automatically deleting empty folders after file transfers.
  • Cleaning up old project directories as part of a scheduled workflow.
  • Removing user-specific folders when offboarding users from a system.

Properties

Name Type Meaning
Folder Path String The path to the folder on the server that should be removed.

Output

The output for the Remove Directory operation is a JSON object indicating success:

{
  "success": true
}

If an error occurs and "Continue On Fail" is enabled, the output will include an error message:

{
  "error": "Error message here"
}

Dependencies

  • External Service: Requires access to an FTP server.
  • Credentials: Needs valid FTP credentials configured in n8n (host, port, username, password, and optional TLS settings).
  • n8n Configuration: The node must be provided with the "basicFtpApi" credential type.

Troubleshooting

Common Issues:

  • Invalid Folder Path: If the specified folder does not exist or the path is incorrect, the operation will fail.
  • Permission Denied: The FTP user may lack permission to remove the directory.
  • Directory Not Empty: Some FTP servers do not allow removal of non-empty directories.

Common Error Messages:

  • "550 Directory not empty": Ensure the directory is empty before attempting to remove it.
  • "No such file or directory": Double-check the folder path for typos or existence.
  • "Permission denied": Verify the FTP user's permissions.

How to resolve:

  • Confirm the folder exists and is empty.
  • Check user permissions on the FTP server.
  • Use the "List" operation to inspect the directory contents before removal.

Links and References

Discussion