Ask AI
Skip to main content

Delete a file from an ftp

Function: Delete a file from an FTP

This action allows you to remove a specific file from an FTP (File Transfer Protocol) server that you have previously connected to using the 'Connect to FTP' action. It's useful for cleaning up old files, managing storage, or automating file lifecycle processes on your FTP server.

Input

  • File: The specific file you wish to delete from the FTP server. This must be a file that was previously retrieved or created on the connected FTP server.

Output

  • STATUS: A text value indicating the outcome of the deletion attempt.
    • SUCCESS: The file was successfully deleted from the FTP server.
    • CONNECTION_FAILED: There was an issue connecting to the FTP server, preventing the deletion.
    • If any other error occurs during the deletion process, an error message will be generated by the platform.

Execution Flow

Real-Life Examples

Here are some scenarios demonstrating how to use the "Delete a file from an FTP" action:

Example 1: Cleaning up daily reports

Imagine you have an automated process that uploads daily sales reports to an FTP server. After a week, you want to delete older reports to save space.

  • Inputs:
    • File: A variable named OldSalesReport which holds the reference to a specific report file (e.g., sales_report_2023-01-01.csv) on your FTP server. This OldSalesReport would have been obtained from a previous action like "List files from FTP" or "Get file from FTP".
  • Result: The sales_report_2023-01-01.csv file is removed from the FTP server, and the STATUS output variable will contain SUCCESS.

Example 2: Removing a temporary file after processing

You've downloaded a temporary configuration file from an FTP server, processed its contents, and now you want to delete the original temporary file from the server.

  • Inputs:
    • File: A variable named TempConfigFile which holds the reference to the temporary configuration file (e.g., temp_config.json) on your FTP server. This TempConfigFile would have been obtained from a "Get file from FTP" action.
  • Result: The temp_config.json file is deleted from the FTP server, and the STATUS output variable will contain SUCCESS.

Example 3: Handling a failed file upload

If a previous action attempted to upload a file to the FTP server but failed, leaving a partial or corrupted file, you might want to delete it before retrying the upload.

  • Inputs:
    • File: A variable named CorruptedUploadFile which holds the reference to the partially uploaded file (e.g., large_data_transfer.zip) on your FTP server. This CorruptedUploadFile would be identified by a previous action.
  • Result: The large_data_transfer.zip file is removed from the FTP server. If the FTP connection was lost during the deletion attempt, the STATUS output variable might contain CONNECTION_FAILED. If successful, it will contain SUCCESS.