West Wind Internet and Client Tools
Odd wwSFTP Behavior
Gravatar is a globally recognized avatar based on your email address. Odd wwSFTP Behavior
  Ken Green
  Nov 23, 2022 @ 09:25am
  1. I create a connection with wwSFTP::FtpConnect()
  2. I want to retrieve the contents of a client's subdirectory so I call

That returns a correct list of 2 files. 3. I get the first filename and add its path and call


with all the correct parameters. That file is returned successfully. 4. I repeat step 3 for the 2nd file. Here's what the parameters look like (password is purposely hidden by VFP): . But this time I get an error message, "Invalid connection SFTP info".

As #3 started with an open connection. I tried this again after closing that connection but then both files got that error.

As the ""Class wwSFTP" help file implies that FTPGetFile() doesn't need a connectionat all. Any clue to whatever it is that I am doing wrong?

Gravatar is a globally recognized avatar based on your email address. re: Odd wwSFTP Behavior
  Rick Strahl
  Ken Green
  Nov 23, 2022 @ 12:29pm

FtpGetFile() connects and then disconnects. I think what you want is to connect, download two files, then disconnect and for that you should probably use the FtpGetFileEx() function along with FtpConnect() and FtpClose() calls.

That said, FtpGetFile() should also work with multiple files as the method is essentially self-contained connection, getting and then disconnecting. I'll check but I'm pretty sure that should work.

+++ Rick ---

© 1996-2022