11-12-2022, 06:00 PM
Hi Remy, Thanks for being so patient with me once again. I have tried adding the suggested setting without Joy. I've listed my current code below. This works perfectly on my home system and copies the desired files to the ftp server. I verify that they are on the server with FileZilla. I've copied the executable to the office server and monitored the process. When I run the program from the office the program fails after the line BobMessage("step2" with the message "entering extended passive mode ..." It never reached step 3 from the office. I can copy files to the ftp server using FileZilla with the same login credentials.
void __fastcall TSendFTP::dbConnectClick(TObject *Sender)
{
dbFTP->Passive = true;
dbFTP->Port = 21;
dbFTP->PassiveUseControlHost = true;
dbFTP->Host = myhost;
dbFTP->Username = myusername;
dbFTP->Password = mypassword;
String resultstext = "ftp unknown failure"; // email report text
bool success = false;
try
{
dbFTP->Connect();
try
{
dbFTP->ChangeDir("//public_html//Map");
Main->BobMessage("Step 2 ");
GetRemoteFilenames();
Main->BobMessage("Step 3 ");
CopyDBtoFTPServer(); // copies files from aisla folder to ftp server
GetRemoteFilenames(); // check on results
resultstext = "Backed up: ";
success = true;
}
catch(const Exception &ex) {
resultstext = "database backup failed, error: [" + const_cast<Exception&>(ex).ClassName() + "] " + ex.Message;
}
catch(...) {
resultstext = "database ftp unknown failure"; ;
}
}
catch(const Exception &ex) {
resultstext = "database backup failed, error: [" + const_cast<Exception&>(ex).ClassName() + "] " + ex.Message;
}
catch(...) {
resultstext = "database ftp unknown failure"; ;
}
if (success == true)
dbFTP->Disconnect();
Main->BobMessage(resultstext.c_str());
}
void __fastcall TSendFTP::dbConnectClick(TObject *Sender)
{
dbFTP->Passive = true;
dbFTP->Port = 21;
dbFTP->PassiveUseControlHost = true;
dbFTP->Host = myhost;
dbFTP->Username = myusername;
dbFTP->Password = mypassword;
String resultstext = "ftp unknown failure"; // email report text
bool success = false;
try
{
dbFTP->Connect();
try
{
dbFTP->ChangeDir("//public_html//Map");
Main->BobMessage("Step 2 ");
GetRemoteFilenames();
Main->BobMessage("Step 3 ");
CopyDBtoFTPServer(); // copies files from aisla folder to ftp server
GetRemoteFilenames(); // check on results
resultstext = "Backed up: ";
success = true;
}
catch(const Exception &ex) {
resultstext = "database backup failed, error: [" + const_cast<Exception&>(ex).ClassName() + "] " + ex.Message;
}
catch(...) {
resultstext = "database ftp unknown failure"; ;
}
}
catch(const Exception &ex) {
resultstext = "database backup failed, error: [" + const_cast<Exception&>(ex).ClassName() + "] " + ex.Message;
}
catch(...) {
resultstext = "database ftp unknown failure"; ;
}
if (success == true)
dbFTP->Disconnect();
Main->BobMessage(resultstext.c_str());
}