I'm trying to download a file from SFTP
using the library SSH.NET
, however I can not save the file in a folder, I wanted to work with it in MemoryStream format, how can I do this?
Below is the code where I connect to sftp and try to get it using sftpFile.
using (SftpClient sftp = new SftpClient(url, usuario, senha))
{
sftp.Connect();
sftp.ChangeDirectory("/HOURLY");
if (sftp.Exists(nomeArquivo))
{
var arquivoSftp = sftp.Get(nomeArquivo);
}
sftp.Disconnect();
}
Thanks.