WebCopy for Upload/Download a files to a SFTP Server

Hello! I'm using to TWebCopy for Upload/Download a files to a SFTP Server.

I'm try to Download one file but the TWebCopy component response: "OLE Exception: C06D007E".

The configuration:

In The "TargetDir" param I especific the local path.
In the "URL" param I especific the sftp file (example: Send/test.txt).
In the "Protocol" param: wpSFTP.
In the other params (FTPHost, FTPPort(22), FTPUserID and FTPPassword) the SFTP configuration.

¿Where is my error?

Hello, fixed by copying libssh2.dll to exe folder

Hello!

I want to retrieve a list of files on the SFTP server, but i don't know that Protocol use.

For FTP Server, is the wpFTPList protocol. I try with that protocol, using a code of example in TMSSoftware.com:

  webcopy.Items.Clear;  
  with webcopy.Items.Add do  
  begin  
     FTPHost := 'example.sftp.com';  
     FTPUserID := 'user';  
     FTPPassword := 'pasword';  
     Protocol := wpFtpList;  
     TargetDir := path_with_root_permissions;  
     URL := '\*.txt';  
  end;  
  webcopy.Execute;  
  for i := 0 to webcopy.Items[0].FileDetails.Count - 1 do  
  begin  
    listbox.Items.Add(webcopy.Items[0].FileDetails[i].FileName);  
  end;

But webcopy.Items[0].FileDetails always is Nil. Where is the problem? Can I obtain the list with SFTP Server?

Hi,

As you also indicated, wpFtpList is for FTP. You should use wpSftpList for SFTP directory listing.

I can't find the unit for wpSftpList, in which version of TMS VCK UI Pack has it been included?

It's in the same unit as the rest: webcopy. It was added in v10.7.6.0 of TMS VCL UI Pack.

Hello, thanks I will update to the latest version, currently I have 10.7.5 installed :smiling_face_with_tear: