Monday, June 08, 2009

Ftp’ing files in Folder in SSIS

Recently, I came across a need to copy all csv files generated from an SSIS process to a Unix server. FTP became handy for this purpose. The FTP SSIS task will not work with folder/directories – came up with error message

File Usage type of connection "xxxxxx" should be "FileExists" for operation Send



This error message is quite misleading. The interpretation is that once you the File Connection Manager being used in the FTP task has a property Usage Type and this Usage Type must be set to “File exists”. This automatically limits the usage of the FTP task to files rather than folder/directories.



The solution is to use the Foreach Loop Container task and place the FTP task within it. Literarily, the loop container enumerates all the files and place them in a variable. This variable is then used in the FTP task.



image 
Foreach Loop Container with FTP task embedded



image


Loop Container configuration



image


FTP task configuration

No comments: