0 votes
by (140 points)
edited

Hi,

I am currently in the process of evaluating the Sftp client library for .NET and am trying to run the SftpFileList_VB console application that was downloaded with the samples.

I am having trouble with the GetList and ChangeDirectory methods on the Sftp object. I have a folder called c:scratch. I am trying to use that folder as the remote path in the program (see FileList.vb).

I get the following errors when running the program with different values for the remote path:

1) setting remotePath = "/C/scratch":

'this line throws exception: Dim list As SftpItemCollection = ftp.GetList()

Rebex.Net.SftpException was unhandled HResult=-2146233088 Message=Permission denied; Permission denied. ProtocolCode=3 ProtocolMessage=Permission denied. Source=Rebex.Sftp Transferred=0

2) setting remotePath = "C/scratch" or "/scratch":

'this line throws exception: ftp.ChangeDirectory(remotePath)

Rebex.Net.SftpException was unhandled HResult=-2146233088 Message=Error 10; The file path does not exist or is invalid. ProtocolCode=10 ProtocolMessage=The file path does not exist or is invalid. Source=Rebex.Sftp Transferred=0

3) setting remotePath = "scratch":

'this line throws exception: ftp.ChangeDirectory(remotePath)

Rebex.Net.SftpException was unhandled HResult=-2146233088 Message=No such file; The file does not exist. ProtocolCode=2 ProtocolMessage=The file does not exist. Source=Rebex.Sftp Transferred=0

Similarly the SftpGetPut_VB console application is throwing exceptions which I believe are related to the remote path.

If someone could put us on the right track it would be much appreciated.

Ron

Applies to: Rebex SFTP

1 Answer

0 votes
by (148k points)
edited

Please try connecting using the SftpWinFormClient sample application to browse and view your SFTP server's directory structure. You might be able to determine the proper remotePath this way. If you are not, please send us SftpWinFormClient sample's log file (either add it to your question or mail it to support@rebex.net) and we'll try to help!

by (140 points)
edited

Thanks for the tip. The client application did not list that particular directory as a possible remote location (this is possibly due to permissions/security of some kind). I pointed to a different folder on my drive and it worked correctly.

Ron

...