This project is read-only.

Trouble Uploading File

May 9, 2014 at 9:02 PM
Edited May 9, 2014 at 9:53 PM
Hello everyone.

I am new to this library so I apologize if this is a really silly question, but I am running into a bit of trouble with uploading a file to a device. Does anyone see anything wrong with this?
Dim upConf As FileStream = New FileStream(fileLocation, FileMode.Open)
Dim radClt = New SftpClient(hostName, 22, userName, uPass)

radClt.Connect()

If (radClt.IsConnected = True) Then
     radClt.UploadFile(upConf, "/tmp/")
     lblEnableResults.Text = "Results: " & Server.MapPath("~/System.cfg")
Else
     lblEnableResults.Text = "ERROR DIDN't Connect to device via sftp"
End If
Here is the error I am receiving.

Renci.SshNet.Common.SshException: Channel was closed.

Thanks in advance!
Coordinator
May 11, 2014 at 8:06 PM
You should specify both a directory/folder and file name in UploadFile.

Cheers,
Gert
Marked as answer by drieseng on 5/11/2014 at 12:06 PM