My SSIS package was developed with the latest version of WinSCP. But the server has 5.7.7. Do you think my SSIS c# code will work on the server?
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = (string)Dts.Variables["User::HostName"].Value,
UserName = (string)Dts.Variables["User::UserName"].Value,
Password = (string)Dts.Variables["User::Password"].Value,
FtpSecure = FtpSecure.Explicit,
};
sessionOptions.AddRawSettings("AddressFamily", "1");
sessionOptions.AddRawSettings("MinTlsVersion", "12");
using (Session session = new Session())
{
session.ExecutablePath = (string)Dts.Variables["User::WinSCPexePath"].Value;
// Connect
session.Open(sessionOptions);
// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
TransferOperationResult transferResult = session.PutFiles(
(string)Dts.Variables["User::LocalFilePath"].Value + (string)Dts.Variables["User::LocalFileName"].Value,
(string)Dts.Variables["User::RemoteDir"].Value,
true, transferOptions);
// Throw on any error
transferResult.Check();