Question:
I use the FTP2 component for building a module to upload a file with ftp to an ftp server. (I’m developing in ASP.NET with Visual Studio 2003) I am having trouble uploading files to the FTP server.
Answer:
Try setting the Ftp2.Passive property = false. This will cause an "active" data connection. Quite often, firewalls block all incoming ports except for a few well-known ones (HTTP, email-related ports, etc.). When an FTP data transfer happens, a data connection is established between the client and server. With a passive connection, the server listens on a socket at a randomly selected port and the client connects. This is the incoming connection that is probably getting blocked by a firewall. With an active connection, the client listens on a socket and the server initiates the data connection. Because the connection is initiated by the server, it is not blocked. This will probably solve your problem (setting Passive = false).