mindweaver
Back again I really need to get some things tested before I buy this (so far) awesome ftp lib. This should be the last major function I need to get working. I can't find any straight forward FXP samples. I looked at the script-example but it didn't work for me. I tried the following code:
1. FXP File
I don't know if it is the right way but it seems like simple way of doing it. This generates an error:
ftpErrorSettingMismatch
2. OnFXPFile Event
This gives me an error aswell, I think I have got the delegates wrong.
Thank you for you patience
1. FXP File
// Load License Key
sfFTPLib.Global global = new sfFTPLib.Global();
if (global.LoadLicenseKeyData("xxxx"))
System.Console.WriteLine("");
// Create an instance of the Ftp class.
FTPConnectionMTA ftpSource = new FTPConnectionMTA();
FTPConnectionMTA ftpDest = new FTPConnectionMTA();
FTPFXP fxp = new FTPFXP();
ftpSource.Host = "sxxx";
ftpSource.Port = xxx;
ftpSource.Username = "xxx";
ftpSource.Password = "xxx";
ftpSource.Passive = true;
ftpSource.Timeout = 10;
ftpSource.LISTOption = 6;
ftpSource.PassiveForceIP = false;
ftpSource.DataProtection = enumDataProtection.ftpDataProtectionPrivate;
ftpSource.Protocol = enumProtocol.ftpProtocolSSLExplicit;
ftpDest.Host = "xxx";
ftpDest.Port = xxx;
ftpDest.Username = "xxx";
ftpDest.Password = "xxx";
ftpDest.Passive = true;
ftpDest.Timeout = 10;
ftpDest.LISTOption = 6;
ftpDest.PassiveForceIP = false;
ftpDest.DataProtection = enumDataProtection.ftpDataProtectionPrivate;
ftpDest.Protocol = enumProtocol.ftpProtocolSSLExplicit;
sfFTPLib.enumError errSource = ftpSource.Connect();
if (errSource == sfFTPLib.enumError.ftpErrorSuccess)
{
sfFTPLib.enumError errDest = ftpDest.Connect();
if (errDest == sfFTPLib.enumError.ftpErrorSuccess)
{
fxp.Source = ftpSource;
fxp.Destination = ftpDest;
fxp.FXPFile("/testfrom/download.gif", "/testto/download.gif", 0, 0);
Console.WriteLine(fxp.LastError.ToString());
}
}
ftpErrorSettingMismatch
2. OnFXPFile Event
fxp.OnFXPFile +=new IFTPFXPEvents_OnFXPFileEventHandler(fxp_OnFXPFile);
public void OnFXPFile(string szSourceFile, string szDestinationFile, int nStartPos) { ... }
This gives me an error aswell, I think I have got the delegates wrong.
Thank you for you patience