Is it possible to get a FTP file Info using SSIS without coping the file into a local Sys

  • HI,

    Is it possible to get a FTP file Info using SSIS without coping the file into a local Sys.

    Can any one help me out on this...pls...

    requirement - need the FTP file(s) informations (at least modified Date) to check whether the file is updated or not, by compairing with another file info that is there in my local Sys.

  • Yes, reach for the script task

    Here is a snippet of code that shows you how using the FtpWebRequest.

    Dim ftpRequest As FtpWebRequest

    Dim ftpResponse As WebResponse

    Dim ftpReader As StreamReader

    Dim directoryDetails As String

    ftpRequest = CType(FtpWebRequest.Create(New Uri("ftp:// "), FtpWebRequest)

    ftpRequest.Credentials = New NetworkCredential(" ")

    ftpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails

    ftpResponse = ftpRequest.GetResponse()

    ftpReader = New StreamReader(ftpResponse.GetResponseStream())

    directoryDetails = ftpReader.ReadToEnd()

    The contents of directoryDetails will be something like this -rw-r--r-- 1 100 2219511 Nov 8 02:55 data.out

    The output depends on your ftp server.

    Norman

    DTS Package Search

    http://www.dtspackagesearch.com/

  • Thanks Norman thx for the help........

    I hv tested it ...it will help me to finish the task.. thanks 1s again...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply