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
  All
  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
wwSFTP::FtpListFiles('/DARTXfer/')

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

wwSFTP::.FTPGetFile()

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 ---

Gravatar is a globally recognized avatar based on your email address. re: Odd wwSFTP Behavior
  Ken Green
  Ken Green
  Dec 2, 2022 @ 12:37pm

I did just that and got it all working just fine using the OnFTPBufferUpdate() to track progress.. But, I have 2 questions:

  1. If I were to send 4 non-trivial-length files using FTPSendFileEx(), the method would return quickly. Would those 4 files all be received correctly?
  2. If the server times me out, how can I detect that lost connection? Thanks, Ken

Gravatar is a globally recognized avatar based on your email address. re: Odd wwSFTP Behavior
  Rick Strahl
  Ken Green
  Dec 3, 2022 @ 01:39am

Not sure what you mean by #1. The upload is synchronous, so it goes until it completes - or doesn't.

#2 a timeout will give you an error that you can handle and decide what you want to do in response.

+++ Rick ---

© 1996-2024