Location: planet earth
Posted: 2013-11-08 19:54
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;
transferrResult = session.PutFiles(localfilename, remotefilename, false, transfer);
see comment line above...it gets to the session.open(sessionoptions) 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 asp.net project, 4.5 framework.
Location: Prague, Czechia
Please post the actual error message.
You can post new topics in this forum
And it's free!