Jump to content
Macro Express Forums

FTP directory list


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

I'm getting stubbed before I even get out of the gate. :blink:

 

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...