0 votes
by (190 points)

Hi, im trying to list cloud folders and files in sftp server. In ftp server when LIST command came to server i make an api call to cloud retrieve list of folders and files and forward to client. How can i do that in rebex sftp server while i cannot intervene client's get list request?

Here is the ftp code;

switch (cmd)
{
   case "USER":
     response = User(arguments);
      break;
   case "PASS":
      response = Password(arguments);
      break;
   case "CWD":
       response = ChangeWorkingDirectory(arguments);
       break;
case "LIST":
    response = List(arguments ?? _currentDirectory);
    break;
}

I can catch the command's from client like this code in ftp, how can i do that in rebex sftp library? If i cant do that is it possible to show cloud folder and files to client?

Applies to: Rebex SFTP

1 Answer

0 votes
by (147k points)
selected by
 
Best answer

The SFTP protocol does not work by sending FTP protocol's commands over SSH shell. SFTP and FTP are two completely different file transfer protocols, despite the similar name.

To have Rebex File Server library provide a SFTP server for accessing a could-based file system, use Rebex.FileSystem assembly and its virtual file system support. Make sure to try the FileServerCustomFS sample that comes with Rebex File Server install package.

by (190 points)
thanks for your help
...