Click here to Skip to main content
16,017,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have to download files from ftp server to insert in to sql server 2008.How can i do it through ssis package...
Posted

1 solution

Use Script Task and download files into your file system. Eg(from MSDN):
C#
using System;
using System.IO;
using System.Net;
using System.Text;

namespace FTPExample
{
    public class WebRequestGetExample
    {
        public static void Main ()
        {
            // Get the object used to communicate with the server.
            FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.contoso.com/test.htm");
            request.Method = WebRequestMethods.Ftp.DownloadFile;

            // This example assumes the FTP site uses anonymous logon.
            request.Credentials = new NetworkCredential ("anonymous","janeDoe@contoso.com");

            FtpWebResponse response = (FtpWebResponse)request.GetResponse();
    
            Stream responseStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(responseStream);
            Console.WriteLine(reader.ReadToEnd());

            Console.WriteLine("Download Complete, status {0}", response.StatusDescription);
    
            reader.Close();
            response.Close();  
        }
    }
}
 
Share this answer
 
Comments
venkatgopal.mandada 16-Jan-13 4:54am    
I want download through package itself......
Kuthuparakkal 16-Jan-13 5:46am    
Use Script Task, I have already mentioned this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900