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. ThisOldSalesReport
would have been obtained from a previous action like "List files from FTP" or "Get file from FTP".
- File: A variable named
- Result: The
sales_report_2023-01-01.csv
file is removed from the FTP server, and theSTATUS
output variable will containSUCCESS
.
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. ThisTempConfigFile
would have been obtained from a "Get file from FTP" action.
- File: A variable named
- Result: The
temp_config.json
file is deleted from the FTP server, and theSTATUS
output variable will containSUCCESS
.
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. ThisCorruptedUploadFile
would be identified by a previous action.
- File: A variable named
- Result: The
large_data_transfer.zip
file is removed from the FTP server. If the FTP connection was lost during the deletion attempt, theSTATUS
output variable might containCONNECTION_FAILED
. If successful, it will containSUCCESS
.