Atozed Forums
Problems with TIdFTP::List() - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Indy (https://www.atozed.com/forums/forum-8.html)
+--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html)
+--- Thread: Problems with TIdFTP::List() (/thread-1983.html)



Problems with TIdFTP::List() - Asger-P - 09-20-2020

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


RE: Problems with TIdFTP::List() - rlebeau - 09-21-2020

(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.


RE: Problems with TIdFTP::List() - Asger-P - 09-22-2020

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


RE: Problems with TIdFTP::List() - rlebeau - 09-22-2020

(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