punisa Posted September 16, 2008 Report Share Posted September 16, 2008 Hello all ! I have a rather (I hope) simple task, but I'm kinda stuck. I created a macro which logs in to my FTP account every 60 seconds. I figured how to download a file from FTP to specific desktop folder. What I need to do now: - check (compare) entire content of FTP folder "files" with a folder "files" on desktop - if there is a new file on FTP, download it to desktop folder - after all checking resume without action IF there is no new files OR take specific action if something downloaded I'm afraid if I jump at this it will probably result in a one mile big script. Which approach would be the best? Quote Link to comment Share on other sites More sharing options...
punisa Posted September 16, 2008 Author Report Share Posted September 16, 2008 I figured how to read every single file in a normal folder, but how can I read EVERY file separatly in an FTP folder? So far I can list files from FTP, but only inside one big T1. Any help? Quote Link to comment Share on other sites More sharing options...
punisa Posted September 16, 2008 Author Report Share Posted September 16, 2008 Hey guys, I got it. For all the future viewers, my solution: - get the FTP folder contents in a T1 variable - Variable -- modify string -- option2 -- save to text file (save T1 content) - files/folders -- text file begin process - loop the "text processing" to get individual FTP files - end text process During the loop you can check if file exists command and see if you have it in desktop folder or not. If not, use the command GET to download needed file (use binary method) And there you go, a handy way to transfer files across FTP to various distant computers. You can have this little script looped according to a time frame (response) you need. I have it looped every 5 minutes. Cheers ! Quote Link to comment Share on other sites More sharing options...
Cory Posted September 24, 2008 Report Share Posted September 24, 2008 You don't need to save to file. You can simply chew thru the variable using the CRLF characters. But making a file is conceptually simpler. BTW there are FTP sync/mirror programs out there already. I use WS_FTP but there are cheaper and even free ones out there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.