Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
idFTP Problem
#8
(11-19-2022, 09:12 PM)OldBob1938 Wrote: I'm attaching the Log file (myerrors.txt)that I received when running my programon the office server.   I've also added the log file when running from my home office (success from home.txt).

The problem is not your faulty, or even TIdFTP's.  The FTP server (or a proxy/router on the network between you and the server) is sending a bad response.

In the scenario that works, TIdFTP sends a PASV command and receives a proper PASV response:

Code:
PRET MLSD
200 Ready to proceed
PASV
227 Entering Passive Mode (67,222,38,61,174,187) <-- HERE
MLSD
150 Accepted data connection
226 6 matches total

In the scenario that fails, TIdFTP sends a PASV command but receives an EPSV response instead of a PASV response:

Code:
PRET MLSD
200 Ready to proceed
PASV
229 Extended Passive Mode Entered (|||34136|) <-- HERE

The only response code that TIdFTP accepts for PASV is 227, not 229, which is why TIdFTP is throwing this response as an error, as it rightly should.  There is a flaw in the communication.  You need to take that up with the network/server admin.

Note: even though the FTP server is advertising support for EPSV, TIdFTP is not using it because its UseExtensionDataPort property is false by default. You can try setting it to true instead to enable EPSV.

(11-19-2022, 09:12 PM)OldBob1938 Wrote: I've finally included the code for GetRemoteFilenames which seems to be where it fails at the office.

Just an FYI, instead of using the TIdFTP::ListResult property, you should consider using the TIdFTP::DirectoryListing property instead, let TIdFTP parse the results for you, eg:

Code:
void __fastcall TSendFTP::GetRemoteFilenames()
{
     dbFTP->List(NULL, "", true);
     int lr = dbFTP->DirectoryListing->Count;
     TLog->Clear();
     for (int i = 0; i < lr; ++i)
     {
          TIdFTPListItem *pItem = dbFTP->DirectoryListing->Items[i];
          if (pItem->ItemType == ditFile)
                TLog->Add(pItem->FileName);
     }
}

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)