FTP Download list of files
Hi All i have to download list of files from FTP location . i have used For each loop container and FTP task inside it . Problem : it is taking lot of time to down load . how to improve performance of this task Surendra Thota
June 21st, 2012 4:00am

Hi Surendra, You can download the all files from ftp to local drive using FTP task and then run the for each loop on local drive. See if it helps.- Chintak (My Blog)
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2012 4:09am

There are so many files at the source . it is not good to get all the files .Surendra Thota
June 21st, 2012 4:22am

How have you designed your package? Can you alter the design by not using the For each loop and FTP Task and replacing them by an Execute Package Task and call any FTP utility to get files. More info: http://www.sqlservergeeks.com/blogs/raunak.jhawar/sql-server-bi/395/sql-server-sftp-with-ssis-execute-process-task This is on SFTP, try the same with any FTP client.Please vote as helpful or mark as answer, if it helps Cheers, Raunak | t: @raunakjhawar | My Blog
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2012 5:12am

Hi Joost i have modified the script task little bit according to my design .Actually iam getting list of file names from sql and iam storing those names in Object variable called SourceFilenamesList. In script task iam connecting to FTP server and seting working directory and assigning the Object variavle SourceFilenameslist to Filenames string array . i hope here is the error . i am getting this error. [FTP Script Task] Error: Error: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Object[]'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface. // Get the ftp connection from the Connection Managers collection ConnectionManager ftpServer = Dts.Connections["FTP Connection Manager"]; // Create a FTP connection object and us the credentials of connection manager FtpClientConnection myFtpConnection = new FtpClientConnection(ftpServer.AcquireConnection(null)); // Open the connection myFtpConnection.Connect(); // Set work folder with the value of the variable myFtpConnection.SetWorkingDirectory(Dts.Variables["FTPSourceFolder"].Value.ToString()); // Create StringArrays for filenames and folders // The folderNames aren't used, but is mandatory // for the next method. String[] fileNames; //String[] folderNames; // Get a directory listing and fill the StringArray variables //myFtpConnection.GetListing(out folderNames, out fileNames); fileNames = (string[])(Dts.Variables["SourceFilenamesList"].Value); // Download all files at once. Don't forget to add the SSIS variable DownloadDirectory to the myFtpConnection.ReceiveFiles(fileNames, Dts.Variables["DownloadDirectory"].Value.ToString(), true, false);Surendra Thota
June 21st, 2012 8:07am

I'm not getting the intentions of your code ( fileNames = (string[])(Dts.Variables["SourceFilenamesList"].Value); ). You're trying the cast a ssis object variable to a string array which is probably not allowed.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2012 1:52pm

Hi Joost This is my first design where i have mentioned about Performance . This process taking lot of Time. That is why i came up with Script task where all the lift of files will downlaod once . there is lot of dirrence in performance . Surendra Thota
June 22nd, 2012 12:14pm

OK good reason... Are you sure the array is filled? Maybe add an if where you count the length of the array fileNamesArray or check if the int variable i is higher then 0. And isn't the path required for each filename in the delete? Check the msdn documentation...Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2012 12:31pm

Hi Joost i have tried with complete file paths and only with file names neither of these worked . i checked in msdn the syntax is correct . any idea why it is not working.Surendra Thota
June 25th, 2012 10:33am

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

Other recent topics Other recent topics