SSIS FTP TASK Delete Local 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 local 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 local file system. Our task is to Delete the existing folder or directory inside the File System Folder and that is New FTP Folder.

SSIS FTP TASK Delete Local Directory 10

SSIS FTP Task Delete Local Directory

In order to delete directory or folder from our local computer, First Drag and drop the FTP Task into the Control Flow region and rename it as SSIS FTP Task Delete Local Directory

SSIS FTP TASK DELETE LOCAL DIRECTORY 1

Double click on it will open the FTP Task Editor to configure it. Within the Connection section, We have one 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. Please refer SSIS FTP Connection Manager article to understand the connection settings

SSIS FTP TASK DELETE LOCAL DIRECTORY 2

Please change the task name according to your requirements and provide the valid description. It is always a good practice to provide the valid description.

SSIS FTP TASK DELETE LOCAL DIRECTORY 3

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 Local Directory 13

The SSIS FTP task supports eight different operation on Files and Folders. In this example we want to delete local folder so, We are selecting the Remove Local Directory option from the Operations property as shown below.

SSIS FTP TASK DELETE LOCAL DIRECTORY 4

For the time being we are declaring the Local path manually but in real-time, we recommend using variables. If we set the IsLocalPathVariable to False, we have to configure the Source Connection using LocalPath Property. If you already created the File Connection Manager you can simply select it from the drop down list otherwise, You have to create by selecting <New Connection..>. as shown in below screenshot.

SSIS FTP TASK DELETE LOCAL DIRECTORY 5

Once you selected the <New Connection..> for files and folders, File Connection Manager Editor will be opened in new window. Using this editor we have to select the required folder from our local file system. To do so, Please click on the Browse button to select the location from the file system.

SSIS FTP TASK DELETE LOCAL DIRECTORY 6

From the below screenshot you can observe that, We selected the NEW FTP FOLDER as the local folder name. It means, following task will delete the NEW FTP FOLDER from E Drive. Click OK button to select it.

SSIS FTP TASK DELETE LOCAL DIRECTORY 7

If you want to use ASCII mode for this operation then Please set the IsTransferAscii property to True otherwise, False

SSIS FTP TASK DELETE LOCAL DIRECTORY 8

Click OK to finish configuring the SSIS FTP task delete local directory package. Let’s run and see whether we successfully Deleted the existing folder or directory from our local File System or not.

SSIS FTP TASK DELETE LOCAL DIRECTORY 9

Well, We successfully deleted the folder or Directory from our local file system.

SSIS FTP TASK DELETE LOCAL DIRECTORY 10