sweileman Posted December 17, 2013 Report Share Posted December 17, 2013 I wonder if someone could help me with an issue using FTP directory list? I've connected to my FTP server and changed to a specific directory. What I'd like to do is GET all the zipped files in the directory but I can't seem to work this through. Anyone care to give me a gentle nudge in the right direction? Thanks, Steve Quote Link to comment Share on other sites More sharing options...
Cory Posted December 17, 2013 Report Share Posted December 17, 2013 I don't use the FTP command much anymore but I thin I would use the FTP Connect then the FTP List Directory command to get a file list. You can optionally specify a file mask like *.zip. Then do a repeat for each with a GET. IE iterate thru them. Don't forget to disconnect when you are done. If I remember correctly I don't think you can do a GET with a wildcard. Quote Link to comment Share on other sites More sharing options...
Look_Up Posted December 17, 2013 Report Share Posted December 17, 2013 When you use "FTP Get File" try another "Transfer Mode" eg. Binary, Unknown (default is ASCII) Look_Up Quote Link to comment Share on other sites More sharing options...
sweileman Posted December 17, 2013 Author Report Share Posted December 17, 2013 I'll give this a try and let you know how it works out....thanks for your help and time! Steve Quote Link to comment Share on other sites More sharing options...
Cory Posted December 17, 2013 Report Share Posted December 17, 2013 If you're connecting to IIS FTP server be aware of problems with PASV. I've never been able to connect to IIS using it. It's controlled in MEP's Connect command with the "Passive transfers" checkbox. Quote Link to comment Share on other sites More sharing options...
sweileman Posted December 17, 2013 Author Report Share Posted December 17, 2013 I'm getting stubbed before I even get out of the gate. I connect to my FTP server, change to the appropriate directory, no errors so far, but when I save my file directory list to a variable, then check the contents of the variable (using a simple display box) all it holds is, "The handle is invalid". Any thoughts or suggestions? Quote Link to comment Share on other sites More sharing options...
Cory Posted December 17, 2013 Report Share Posted December 17, 2013 Did you log the result for each command? IE are you sure the connect and change directory commands are working properly? For instance I get the text below. What do you see? 230 User Cory logged in. 250 CWD command successful. Also once you have the list you will need to split it. I suggest creating string variables for Carriage Return and Line Feed and splitting on them combined into a new array. Then you can simply go thru each element of the array for your GET command. Quote Link to comment Share on other sites More sharing options...
Look_Up Posted December 18, 2013 Report Share Posted December 18, 2013 "The handle is invalid" indicate that you try to save the filename in handle variable and Macro Express doesn't accept this. Try to save the name of fileslist in "string" variable just the way like Cory has proposed > as array (string variable[x] ) Quote Link to comment Share on other sites More sharing options...
sweileman Posted December 18, 2013 Author Report Share Posted December 18, 2013 Did you log the result for each command? IE are you sure the connect and change directory commands are working properly? For instance I get the text below. What do you see? 230 User Cory logged in. 250 CWD command successful. Also once you have the list you will need to split it. I suggest creating string variables for Carriage Return and Line Feed and splitting on them combined into a new array. Then you can simply go thru each element of the array for your GET command. Ok...thanks for your advice. That got me headed in the right direction. I was logging the results but I was relying on error messages which didn't show up. When I checked the results I found that I wasn't actually logging in; once I took care of that the rest started to fall into place. Also, your other suggestions about splitting on Carriage Return and Line Feed solved the next issue I was scratching my head about. Thanks to everyone for your time and helping hand! Steve 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.