DownloadFile with stream

0
Hello! I am in the process of testing the sftp component. Works fine but I'm having a strange problem when downloading a file to a file stream. sftpClient.DownloadFile(fileName, destinationFile); //string to string. This works fine BUT using (var stream = File.Open(destinationFile, System.IO.FileMode.Create,System.IO.FileAccess.Write, System.IO.FileShare.None)) { sftpClient.DownloadFile(fileName, stream); } results in an exception "Object reference not set to an instance of an object.". The stream is created fine but shows 0 b after the exception, of course. What am I doing wrong?
 
asked 3/2/2020 1:01:23 PM
add a comment

3 Answers

1
Let us check again. The released version already passed such simple test. I guess something to do with the certificate or signature. We will get back in 12h.
 
answered 3/3/2020 2:31:51 PM
add a comment
0
Hello! Could you please tell me the status of this issue? I need to report to my team and I'm between ComponentPro and edtFtpNetPro right now. This is the only issue prevent us to use this library. Regards
 
answered 3/18/2020 2:20:35 PM
add a comment
0
Thanks! If this serves as any help, uploading a file seems to work fine. using (var stream = File.Open(source, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None)) { sftpClient.UploadFile(stream, fileName); }
 
answered 3/3/2020 8:37:20 PM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged sftp or ask your own question.