Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: After downloading file from SFTP, we will get null value in the file extension parameter.

$
0
0

We are using latest version of SSH.Net library. We are getting null value in the file extension once file is downloaded from the server. Please check below BOLD word "myFile". When we check the properties of this paramter we are gettting null value in the extension parameter.

Please check below code.

IEnumerable<Renci.SshNet.Sftp.SftpFile> myfileList = client3.ListDirectory("/.");

            foreach (Renci.SshNet.Sftp.SftpFile myFile in myfileList)
            {
                if (myFile.Name == "ABC.csv")
                {
                    var mem = File.Create("D:\\temp\\ABC.csv");
                    var asynch = client3.BeginDownloadFile("/ABC.csv", mem, null, null);
                    var sftpAsynch = asynch as Renci.SshNet.Sftp.SftpDownloadAsyncResult;
                   
                    client3.EndDownloadFile(asynch);

                }
            }


Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>