1

I am using SharpSsh library to get file names from sftp server. Connection is OK but I get exception of type 'Tamir.SharpSsh.jsch.SftpException' in this code:

_sftp.GetFileList("/outgoing")

When I was testing my code on my local sftp server on Windows the result was file names array. But in production we use sftp server on Linux and now I get this exception. Can anybody tell me how to specify path argument in GetFileList for sftp server on Linux.

Thanks!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • Please share exception details with us. – Martin Prikryl Apr 30 '13 at 14:13
  • There are no detailed information for this exception. Just this: Tamir.SharpSsh.jsch.SftpException: Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown. at Tamir.SharpSsh.jsch.ChannelSftp.ls(String path) at Tamir.SharpSsh.Sftp.GetFileList(String path) – Александр Сысоев Apr 30 '13 at 15:54
  • It has to have at least text message associated. Please inspect it again. – Martin Prikryl Apr 30 '13 at 16:36
  • Are you sure the destination folder has enough permissions for the user to perform a folder list?. Remember the sftp server (ftp over ssh) use the same permissions that the user. Log with ssh console and perform a "ls" command being logged with that user to see if files get listed. – Carlos Landeras May 03 '13 at 06:44
  • Carlos Landeras, I was successfully connected to sftp with this user with putty ssh client. I think this problem is because of the difference between folder full path in Linux and Windows. – Александр Сысоев May 06 '13 at 07:33

1 Answers1

2

I was able to make it work removing the initial slash:

_sftp.GetFileList("outgoing")

ceconic
  • 36
  • 2