Pages

Wednesday, October 10, 2012

SSIS : FTP Task–Step by Step

FTP task is used to do file operations using SSIS in our remote ftp. We can see more information about FTP task in technet. Following is the step by step walkthrough on how to configure your FTP task to send a file from local system and remote ftp.

  1. Right click on the connection manager and click “New connection”. You will be prompted with the following screen.

clip_image001

  1. Select “FTP” and click “Add” button. You need to enter the credentials, if you have any specific ftp portal to be used you can contact your customer or administrator for the following details. In my case, I have configured it locally.
    • Server name
    • Port name [ if they configured any]
    • User Name and password of portal to connect. Please check with your customer about the permission [read / write]. You need to be sure that your going to download files, send the files , deleting the file in your ftp portal and get appropriate permission.
    • Others are optional parameters, if you want to configure about retries and timeout, you can do it here.

clip_image002

  1. Drag your “FTP task” into your “control flow”.
  2. Click on the “FTP task” to configure. If you want to set package to fail on FTP connection problem, you can set the property “StopOnFailure” to true. Take a look at the following screenshot.

clip_image003

  1. Click on the “File Transfer”. Need to mention the local and remote path of the FTP to do the file operations.
    • Local parameter, If we are preparing the file information in the variables, we need to set to true for “IsLocalPathVariable” to true. Otherwise create new file connection.
    • Operations, Select the required operations you want to do. In my case, I wanted to send my local file to the remote FTP, so I have configured it for “Send files”
    • Remote parameter, If we are preparing the file information in variable, we need to set the “IsRemotePathVariable” to false. Otherwise click on the RemotePath, you will be notified the folder structure inside the remote FTP.

Important:

Remote path will not take a full path like “ftp://localhost/<YourFolder>”. So if your using the variable, use it like “/<YourFolder>”.

clip_image004

Testing:

Package looks like follow. I have done task to send a local file to the remote ftp site.

clip_image005

I am sending the files from my local machine to the remote site ftp://localhost/TestXml/. , once I run file is send to the portal. Please take look at the following screenshot

clip_image006

Other implementations:

  1. We can send all the files in the folder using the for each loop container and call the FTP task to send the files into remote ftp.
  2. We can download the file and move the file to our local environment and use it for the ETL purpose.

Thanks,

Gowdhaman

1 comment: