Link to home
Start Free TrialLog in
Avatar of tdantona
tdantonaFlag for United States of America

asked on

Want CFFTP to download all newer files from remote FTP server

Hi all,

I want to use a CF page to access a remote FTP server and download all NEWER files to a local directory on the CF Server. I am currently able to access the remote FTP Server and return a Directory Listing so the access portion is working.

Any suggestions as to the best approach to GET all NEWER files from the FTP Servers root directory as well as all sub-directories and save them to the same relative paths on the local CF server.

Thanks to all for your input,
Avatar of usachrisk1983
Flag of United States of America image

Haven't done it myself, but I would use ACTION="LISTDIR" to get the LastModified property of each file, and compare that with what your "older" files date is to see the difference.  More info on CFFTP and ListDir here:
Avatar of tdantona


Well, that's the tip of the ice burg. I currently perform the LISTDIR function and it returns good info but only for the root directory. I'm thinking there must be an established method to compare all of the files in all sub-directories and retrieve and overwrite all newer files. There will be a couple thousand to go through and perhaps a couple hundred sub directories.

There's no recursive function for CFFTP, you'll need to loop through and get directories and search those as well.  Someone may have already written one that does what you're looking for, but I couldn't find any results via google for you.  It might be faster to write it than to search for it ;)
Avatar of dgrafx
in certain instances it can be fun and challenging to write an advanced directory crawl.
but in this case it seems that you should simply be using the "folder synchronization" tool in an FTP client.
I'm only familiar with a few, but what I use is CuteFTP Pro, if you need a recommendation.
The synchronization tool can go either way. Make local like remote or make remote like local.

good luck ...
That would work if I was at the machine. In this case, I want a remote SERVER to pull files from a remote workstation and copy all new files to the REMOTE SERVER, so no client can be used. I will somehow need to at least be able to create a text file with all of the directory and file information in it then use that to run the CFTP command to move through the list and download any updated files to the remote SERVER.

Guess I'm hoping there is code being shared or offered for purchase that will streamline this for me.

Still waiting. . .
Avatar of dgrafx
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Researching iDirectory Now, thanks.
I worked with the developer "great guy" and he customized iDirectory as iDirectory Plus - check it out on their site (above)