I need to read a file from SFTP location using WinSCP .NET assembly in C#. I'm able to download file from SFTP location to local path and read it. But is there a way to read the file content directly without downloading to local path?
Below is the code used for downloading. But I see no option available to read the file content directly in WinSCP... something like using response, stream etc...
TransferOptions objTransferoptions = new Transferoptions()
objTransferoptions.transfermode = Automatic
Session objsession = new Session()
objsession.Open()
objsession.GetFiles(remotepath, localpath, false,objTransferoptions)
Can someone please let me know, if it is possible to read file contents directly from SFTP location? Thanks in advance!
EDIT:
To extend the above question. Can anyone please tell me is that possible to copy files between SFTP remote location (from Remote location 1 to remote location 2 in same SFTP server).
Pls note: I need to Copy files, not to move.