SSIS FTP Task Delete Local Files

In this article, we will show you the steps involved in configuring the SSIS FTP task to delete local files with examples.

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

The below screenshot shows you the data inside the local file system. Our task is to Delete the existing file present in the File System Task Folder, that is, Cache.xml.

SSIS FTP TASK DELETE LOCAL FILES 0

SSIS FTP Task Delete Local Files

In order to delete files 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 Files

SSIS FTP TASK DELETE LOCAL 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 LOCAL 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 Local Files 10

The SSIS FTP task supports eight different operations on Files and Folders. In this example, we want to delete the file present in our local file system, so we select the Delete Local Files option from the Operations property, as shown below.

SSIS FTP TASK DELETE LOCAL FILES 3

Next, we have to configure the Local Parameters. 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 the LocalPath Property. If you have 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 the below screenshot.

SSIS FTP TASK DELETE LOCAL FILES 4

Once you select the <New Connection..>, File Connection Manager Editor will be opened in a new window. Using this editor, we have to select the required file from our local file system. To do so, please click the Browse button to select the location from our file system.

SSIS FTP TASK DELETE LOCAL FILES 5

From the below screenshot, you can observe that We selected Cache.xml as the file name. It means the following task will delete the Cache.xml file from E Drive. Click the Open button to select it.

SSIS FTP TASK DELETE LOCAL FILES 6

Click OK to finish configuring the SSIS FTP task delete local files package.

SSIS FTP TASK DELETE LOCAL FILES 7

Let’s run and see whether or not we successfully Deleted the Cache.xml file from our local File System.

SSIS FTP TASK DELETE LOCAL FILES 8