Receive files from remote server only if does not exist on local server via FTP in SSIS 2008
Hi, I am very new to SSIS. I have a FTP task that receive multiple files from a FTP Server. Now, I want to receive only those files that are not downloaded yet ,i.e, files that do not exist on local directory. Pls Help with details.Thanks and regards, Rishabh
December 23rd, 2010 12:40am

first you should get list of file names in ftp remote address, you can do it with a script task with C# or VB.NET code, and write results to a datatable and fill this data table into an object type variable then in a foreach loop, loop through these file names by set enumerator as ado enumerator and set object type variable from previous task here. inside the foreach loop put another script task to check existance of file on local folder, you can do it with System.IO.File.Exists() method. put a ftp task after script task inside the foreach loop, and connect precedence constraint from script task to this ftp task, use expression for checking if file exists of not. then in ftp task you can Receive this file. this was whole schema, but lots of details are here, let me know where you need more information.http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
December 23rd, 2010 12:55am

Hi Reza, Thanks for your reply your blogs are very helpful.Thanks and regards, Rishabh
December 23rd, 2010 1:38am

Hi Reza, Just one thing suppose we haven't downloaded any file yet. So in that case what value will be assigned to variable filename??Thanks and regards, Rishabh
Free Windows Admin Tool Kit Click here and download it now
December 23rd, 2010 2:07am

in first script task you get all file names with .NET code, and then you can fill this result in foreach loop on filename variable. for clarifying: this sample will get list of file names into a list: http://codesmithdotnet.blogspot.com/2008/01/get-file-list-from-server-using-ftp-web.html then you can loop through this list in a foreach loop, and in variable mapping tab of foreach loop assign each file name to a variable. does it make sense to you?http://www.rad.pasfu.com
December 23rd, 2010 2:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics