Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with TIdFTP::List()
#1
Hi

I get this error: 
EIdReplyRFCError with message 'PORT address does not match originator.'

when I try to do a listing using  IdFtp->List();

Connecting is successful.

I have used the same code some years back and at that time it worked, but now something have changed so that it doesn't work anymore.
FileZilla still works with the same settings.

What am I missing ?

Thanks in advance
Best regards
Asger
Reply
#2
(09-20-2020, 08:39 AM)Asger-P Wrote: I get this error: 
EIdReplyRFCError with message 'PORT address does not match originator.'

when I try to do a listing using  IdFtp->List();

By default, TIdFTP uses active mode for transfers. That means TIdFTP opens a listening port for the FTP server to connect to, where the listening IP/Port is specified via a PORT command. I suspect the error likely means that the listening IP specified in the PORT command does not match the IP that TIdFTP originally connected to the FTP server from. TIdFTP uses the locally bound connected IP for the listening transfer IP. But if your FTP connections are passing through a router/NAT that is not FTP-aware to alter IPs specified in FTP commands, that could certainly cause issues. If that is the case, you can try using the TIdFTP.ExternalIP property to specify the router/NAT's public WAN IP for use in PORT commands.

Otherwise, try setting TIdFTP to use passive mode for transfers instead. That means the FTP server will open a listening port for TIdFTP to connect to. This is much more friendly to routers/NATs.

(09-20-2020, 08:39 AM)Asger-P Wrote: FileZilla still works with the same settings.

But, is FileZilla using active mode or passive mode for its transfers? It makes a difference.

Reply
#3
Hi Remy

Thank you very much.
Setting IdFtp->Passive = true; did the trick.

Filezilla just uses Default, but I can also chose either Active or Passive,
so I guess it can negotiate what to use.

P.s. Any chance of Indy being able to handle SFTP (FTP over SSH) ?

Best regards
Asger
Reply
#4
(09-22-2020, 05:49 AM)Asger-P Wrote: P.s. Any chance of Indy being able to handle SFTP (FTP over SSH) ?

Not any time soon, but it is in Indy's issue tracker: #18: Add support for SSH

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)