FTP works by using communications in two ports, the control channel and the data channel.
The control channel is always on the same, predefined port, the default being 21. Since it's a well-known port, it is easy for the web server's host to open that port in their firewall.
Data transfer, however, takes place over the data channel. This is a randomly assigned port. Naturally, you can't open all possible ports on the firewall because you'd then have no firewall. What actually happens is that there is a kernel driver which figures out which port is going to be used and opens it temporarily in the firewall. For more technical info, see https://unix.stackexchange.com/questions/587965/how-is-netfilter-able-to-track-the-out-of-band-data-connections-of-ftp-to-be-in
If your web host has not set up their firewall correctly – either by not using a conntrack
rule in the firewall, or by not loading the kernel module – any attempt to upload to an FTP server from that host will fail.
And yes, in this case the FTP connection test would succeed, but the transfer would fail. As I mentioned earlier, connecting and logging into an FTP server (and creating / renaming / removing directories, moving / deleting files, and generally everything except file upload and download) takes place over the control channel on the well-known TCP/IP port. The FTP connection test only tries to open the connection to the control channel, log into the server, and change into the directory you have specified. That's all it can check. This is not blocked by your web host, therefore it succeeds.
The part that fails is the data transfer, communicating over the data channel. This appears to be filtered by your web server host's firewall which is why the connection times out. When we say that the connection times out we mean that the connection was never established. Nothing was transferred. The network speed of your servers is irrelevant.
Go with this information to both of your hosts and see which one is blocking the connection.
And, please, do make sure that you are using Passive mode. Doing the opposite will definitely not work on a server with a properly configured firewall. That's why I asked that question first :)
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!