Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
idFTP Problem
#2
(10-31-2022, 07:23 PM)OldBob1938 Wrote: It no longer works from the office computer that it runs on.

Can you be more specific? What is the exact problem you are having with it?

(10-31-2022, 07:23 PM)OldBob1938 Wrote: Here's the code which does report to me each day on success/failure.

You don't need the call to Connected(), as Connect() will raise an exception if it fails - which you are not catching! You should move Connect() inside the try block, eg:

Code:
String resultstext = "Backed up: ";
try {
    dbFTP->Connect();
    try {
        dbFTP->ChangeDir("/public_html/Map");
        GetRemoteFilenames();
        Delay(1);
        CopyDBtoFTPServer();       // copies files from aisla folder to ftp server
        GetRemoteFilenames();      // check on results
    }
    __finally {
        dbFTP->Disconnect();
    }
}
catch(...)  {
    resultstext = "database backup failed";
}
Main->SendaneMail(resultstext);

What does GetRemoteFilenames() do, and why is it being called twice?

Why are you using Delay(1)?

Your catch block is discarding all useful error information. If you catch an Exception object instead (or in addition to '...'), then you will have access to the exception's class type, error message, etc, which you can then include in your failure report, eg:

Code:
catch(const Exception &ex) {
    resultstext = "database backup failed, error: [" + const_cast<Exception&>(ex).ClassName() + "] " + ex.Message;
}
catch(...) {
    resultstext = "database ftp unknown failure";
}

(10-31-2022, 07:23 PM)OldBob1938 Wrote: Where can I find a list of commands for the idFTP module?

What commands are you interested in? If you look at the declaration of the TIdFTP class in the IdFTP.hpp header file, you will see the available commands you can call. If you want to know the low-level FTP commands that TIdFTP implements, you would have to look at its source code in IdFTP.pas.

Reply


Messages In This Thread
idFTP Problem - by OldBob1938 - 10-31-2022, 07:23 PM
RE: idFTP Problem - by rlebeau - 11-01-2022, 04:04 PM
RE: idFTP Problem - by OldBob1938 - 11-09-2022, 04:32 PM
RE: idFTP Problem - by rlebeau - 11-09-2022, 06:44 PM
RE: idFTP Problem - by OldBob1938 - 11-12-2022, 06:00 PM
RE: idFTP Problem - by rlebeau - 11-14-2022, 09:35 PM
RE: idFTP Problem - by OldBob1938 - 11-19-2022, 09:12 PM
RE: idFTP Problem - by rlebeau - 11-22-2022, 11:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)