I am facing issue uploading large files using sftp or scp (Renci.SshNet).
Twice failed after uploading 1071972960 bytes.
"An established connection was aborted by the software in your host machine"
Dim pkeyFile As PrivateKeyFile = Nothing
Dim client As SftpClient = Nothing
Dim myFileStream As System.IO.FileStream = Nothing
pkeyFile = New PrivateKeyFile(privateKey, FTPPassword)
Dim fi As New FileInfo(inputfile)
client = New SftpClient(FTPHost, FTPPort, FTPUsername, pkeyFile)
client.OperationTimeout = New TimeSpan(2, 0, 0)
client.BufferSize = 1024 * 16
client.KeepAliveInterval = New TimeSpan(0, 1, 0)
myFileStream = New System.IO.FileStream(inputfile, FileMode.Open, FileAccess.Read)
client.UploadFile(myFileStream, "/home/" & FTPUsername & ftppath)
Catch ex As Exception
Throw New Exception("Sftp upload fails. " & ex.Message)
myFileStream = Nothing
client = Nothing
Please guide me how to upload large files using sftp or scp.