SSIS FTP Task Delete Remote files

The FTP Task is used to perform different kinds of operations on Files and Folders (or Directories). In this article, we will show you the steps involved in configuring the SSIS FTP task Delete Remote files with examples.

The below screenshot will show you the data inside the FTP Server. Our task is to delete one or all the files (.txt, .xls, .jpg) present inside the FTP Server’s Root directory.

NOTE: The SSIS FTP Task uses the FTP Connection Manger to connect with the Remote (FTP Server) Files and Folders.

SSIS FTP Task Delete Remote files 8

SSIS FTP Task Delete Remote files

In order to delete files from the FTP Server, First Drag and drop the FTP Task into the Control Flow region and rename it as SSIS FTP Task Delete Remote files

SSIS FTP TASK DELETE REMOTE FILES 1

Double click on it will open the FTP Task Editor to configure it. Please change the task name according to your requirements and provide a valid description.

Within the Connection section, We have a property called FTPConnection. Clicking on the drop-down arrow will show you the already created FTP Connections (If any), or please click on the <New Connection..> option to create one. In this example, We are using the already created Connection (FTP Connection Manager), as shown below. Please refer to the FTP Connection Manager article to understand the connection settings

SSIS FTP TASK DELETE REMOTE FILES 2

Please click on the File Transfer tab to configure the FTP operations. The following screenshot will show you the available properties in this tab.

SSIS FTP Task Delete Remote files 10

The SSIS FTP task supports eight different operations on Files and Folders. In this example, we want to delete the existing files inside the FTP Server. So, we are selecting the Delete Remote Directory option from the Operations property

SSIS FTP TASK DELETE REMOTE FILES 3

For the time being, we are declaring the Remote path manually, but in real-time, we recommend using variables. Please click on the browse (…) button beside this option to open the remote directory.

SSIS FTP TASK DELETE REMOTE FILES 4

From the below screenshot, you can observe that / is the location because it is the root directory of the FTP server, and currently, we don’t have any subfolders. We can select the required file from the directory if you want to delete a single file.

SSIS FTP TASK DELETE REMOTE FILES 5

Click the OK button to select it.

SSIS FTP TASK DELETE REMOTE FILES 6

If you want to delete multiple files, we can use Wildcards. Here, we want to delete all the files present in the FTP Server, so we are using *.*.

SSIS FTP TASK DELETE REMOTE FILES 7

Click OK to finish configuring the SSIS FTP task Delete Remote files package. Let’s run and see whether we successfully deleted the existing files from our FTP Server or not.

SSIS FTP TASK DELETE REMOTE FILES 8

From the screenshot below, we successfully deleted all the existing files inside our FTP server.

SSIS FTP TASK DELETE REMOTE FILES 9

Comments are closed.