- I create a connection with wwSFTP::FtpConnect()
- 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?
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 ---
I did just that and got it all working just fine using the OnFTPBufferUpdate() to track progress.. But, I have 2 questions:
- 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?
- If the server times me out, how can I detect that lost connection? Thanks, Ken