Hi Ali,
Please refer to the following example:
static void StreamExample()
{
using( SSHClient ssh = new SSHClient() )
{
ssh.Connect( “host” );
ssh.Authenticate( “USERNAME”, “PASSWORD” );
using( SFtpSession sftp = new SFtpSession( ssh ) )
{
AbstractFile remoteFile = new SFtpFile( sftp, “MyFile.dat” );
using( Stream stream = remoteFile.OpenRead() )
{
/* You now have a System.IO.Stream from the remote file.
* You can read the remote file’s data. */
}
}
}
}
If you want a System.IO.Stream to upload data to a remote SFtp file, we suggest you take a look at the technique used in an example in our documentation. It uses a Stream to upload while maintaining good performance:
http://doc.xceedsoft.com/products/XceedFileSystem/#topic271.html
Applies to Xceed SFTP for .NET. Imported from legacy forums. Posted by Diane [Xceed] (had 637 views)