SSIS FTP TASK Delete Remote Directory

The SSIS FTP Task is used to perform different kind 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 directory with example.

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

Below screenshot shows you the data inside the FTP Server. Our task is to Delete the existing folder or directory inside the FTP Server Root directory and that is New_FTP_Folder.

SSIS FTP TASK Delete Remote Directory 10

SSIS FTP Task Delete Remote Directory

In order to delete directory or folder from our FTP Server, First Drag and drop the FTP Task into the Control Flow region and rename it as SSIS FTP Task Delete Remote Directory as shown below

SSIS FTP TASK DELETE REMOTE DIRECTORY 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 the valid description.

Within the Connection section, We have a property called FTPConnection. By 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 SSIS FTP Connection Manager article to understand the connection settings

SSIS FTP TASK DELETE REMOTE DIRECTORY 2

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

SSIS FTP TASK delete remote directory 14

The SSIS FTP task supports eight different operation on Files and Folders. In this example we want to delete the existing folder inside the FTP Server so, We are selecting the Remove Remote Directory option from the Operations property

SSIS FTP TASK DELETE REMOTE DIRECTORY 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 besides this option to open the remote directory.

SSIS FTP TASK DELETE REMOTE DIRECTORY 4

From the below screenshot you can observe that / as the location because it is the root directory of FTP server and currently we have only one sub folder. Here, we are selecting the New_FTP_Folder as shown below. Click OK button to select it.

SSIS FTP TASK DELETE REMOTE DIRECTORY 5

Click OK to finish configuring the SSIS FTP task delete remote directory package.

SSIS FTP TASK DELETE REMOTE DIRECTORY 6

Let’s run and see whether we successfully deleted the existing folder (New_FTP_Folder) from our FTP Server or not.

SSIS FTP TASK DELETE REMOTE DIRECTORY 7

From the below screenshot you can observe that, We successfully deleted the existing folder New_FTP_Folder inside our FTP server

SSIS FTP TASK DELETE REMOTE DIRECTORY 8