[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1440
  • Last Modified:

Using SSIS to retrieve the most recent file via ftp

I am currently using SSIS for loading data feeds via ftp and need to query the ftp site to ensure that the file being downloaded is the latest file when compared to the previously downloaded file that has the same name, whose time stamp is persisted in the database. My question - is there a way to retrieve the time stamp from a file located on the ftp site prior to downloading it. Essentially I want to compare timestamps prior to making a decision to download. For example if the time stamp on the ftp site for file x is greater than that of file x which was downloaded the day before then download file. I figured I would need to use a script task instead of the ftp task. Any help would be greatly appreciated.
0
Khopkins32
Asked:
Khopkins32
  • 2
  • 2
1 Solution
 
PedroCGDCommented:
I know how can you get the file attributes after download the file from ftp server... before I dont know if it's possible... maybe by .net code inside a script...
0
 
HoggZillaCommented:
The only way I know is to use a third part tool for .net, like Rebex
Here is their sample to get modified date. This could be used in a Script Task.
' select the desired directory
ftp.ChangeDirectory("path")

' retrieve and display the list of files and directories
Dim list As FtpList = ftp.GetList()
Dim item As FtpItem
For Each item In list
    Console.Write(item.Modified.ToString("u"))
    Console.Write(item.Size.ToString().PadLeft(10, ""c))
    Console.Write(" {0}", item.Name)
    Console.WriteLine()
Next item
 
0
 
Khopkins32Author Commented:
This would work perfectly. Do you know if there is a freeware version of this. I would like to avoid have to pay for third party tool. But nonetheless, this is a good start
0
 
Khopkins32Author Commented:
Thanks for your help on this. I was actually able to find a shareware solution for this. This solution definitely pointed me in the right direction. Thank you
0
 
HoggZillaCommented:
I would like to see your solution, please share when you can. Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now