Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4783 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi There,

I am trying to automate a download of a text file that is sitting on an ftp site.

The file has a file name which looks something like this "Filename_Date_Time_.csv" eg "Filename_20111107_155324_.csv"

The problem is for ever new file there is a new time stamp and I am not able to automate the download as I never know the full name of my file. I have no problem scheduling the download from a file that I know the full name of. (the company I am doing the downloads from won't remove the time stamp from within the file name) What I am trying to do is download the file only knowing the files prefix.

Is there a way I can download the file just knowing the first two values i.e. the file name and the date of the file... The time will always be different.

I would like to download the file with todays date (FTP_DownloadFile), then remove it off the server (FTP_DeleteFile), then check if there are any other for today?

Any suggestions would be greatly appreciated.

Thanks,

Jake

Posted

When faced with a similar problem, I used their FTPeek_GetFileList ( { remoteDir } ) to read the contents into a $var and then looped and processed.

  • Like 1
Posted

I used their FTPeek_GetFileList ( { remoteDir } ) to read the contents into a $var and then looped and processed

This is exactly right, FTPeek_GetFileList returns the files in the directory in the alphabetical order, so you can look for the last file matches the prefix you're looking for.

This topic is 4783 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.