I have an FTP connection to a UNIX system using Rebex FTP/SSL version 4.0.5715.0.
I gave up on trying to download the set since that seems to timeout after the first file, so I'm downloading each individual file.
After calling the download() method, the file on the ftp site disappears. Poof. I have tried the overloaded method to make sure it's a TransferMethod.Copy and still, Poof. Tried many different overloads....
How do I download the file without it automatically calling a delete? is it?
(Is this something happening on the other end possibly? Like THEM deleting the file automatically after it's been downloaded 1 time?)
Ftp ftp = new Ftp();
try
{
ftp.Settings.SslAcceptAllCertificates = true;
ftp.Settings.SslAllowedVersions = TlsVersion.SSL30 | TlsVersion.TLS10;
ftp.Settings.ForceListHiddenFiles = true;
ftp.Connect(sftpServer, 990, SslMode.Implicit);
ftp.Login(sftpUser, sftpPassword);
//var dir = ftp.GetCurrentDirectory();
var files = ftp.GetList("*.ISA");
//var fileSet = new Rebex.IO.FileSet(dir);
//fileSet.Include("*");
//var set = ftp.GetItems(fileSet);
foreach(var file in files)
{
try
{
ftp.Download(file.Path, orderDropOffPath,0,Rebex.IO.TransferMethod.Copy,0);
if(CheckLastWrite(orderDropOffPath + file.Name))
{
//delete file!
}
}
catch (Exception exc)
{
logger.Error(exc);
}
}
ftp.Disconnect();
}
catch (Exception e)
{
logger.Error(e);
try
{
ftp.Disconnect();
}
catch (Exception ex)
{
logger.Error(ex);
}
}