Topic "issue with provided public key"

Author Message
[View user's profile]

Joined: 2013-11-08
Posts: 1
Location: planet earth
I am trying to interface with a partner FTP site using SFTP, I've gotten the winscp package for .net.

code looks like

        protected void UploadViaWINSCP()
            var sessionOptions = new SessionOptions
                Protocol = Protocol.Sftp,
                HostName = ConfigurationManager.AppSettings["Host"],
                UserName = ConfigurationManager.AppSettings["username"],
                Password = ConfigurationManager.AppSettings["password"],
                SshHostKeyFingerprint = "ssh-rsa 1024 xx:xx:xx:xx etc",
                PortNumber = 22
            var localfilename = @"~/DataStore/" + ViewState["FileName"];
            var remotefilename = Path.GetFileName(localfilename);
            using (var session = new Session())
                session.DisableVersionCheck = true;
                session.Open(sessionOptions);  //gets here and crashes
                TransferOptions transfer = new TransferOptions();
                transfer.TransferMode = TransferMode.Binary;
                TransferOperationResult transferrResult;
                transferrResult = session.PutFiles(localfilename, remotefilename, false, transfer);

see comment line gets to the and kicks back with server said public key, which i have in a .pub file (both server and other). How do i use the public key file provided by the trading partner to upload a file to them, basically on demand, this is part of a larger project, 4.5 framework.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27106
Location: Prague, Czechia
Please post the actual error message.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License