Home |
FTP Client |
FTP ClientFTP, the File Transport Protocol, is a client/server protocol that allows a client to transfer files to and from a server. It also provides directory listing and working directory management routines. The client is provided through a small set of API calls. File I/O is implemented through a user-supplied callback function, allowing applications to use the FTP clients even if they do not use a real file system. Active ModeIn active mode, the FTP client will restrain the connection to using the standard server ports of 20 and 21. The client will first establish a connection to the server's command port 21 from an arbitrary unprivileged port. The client then begins to listen on a port determined by adding one to this client command port and then sends a PORT command containing this information to the server over the command port. The server connects back to the client using its data port 20 to the clients port, which was in the PORT command. Passive ModeMany firewalls will not permit a server to connect out on a privileged port, such as 20, and are thus not compatible with active mode. An FTP client in passive mode is used as a work-around. It enables a data connection to be made from the client on an unprivileged port to an unprivileged port on the server side. This is done by having the client initially connect to the server on the command port 21 using an arbitrary unprivileged port. After connecting, the client begins listening on a data port determined by adding one to the clients command port. The client sends an empty PASV command telling the server that it wants to run in passive mode. The server responds to the client using a PASV command containing the IP address and the port number that the server is listening on for the client to connect. The client finally connects, using the client-side data port, to the unprivileged data port (contained in the PASV command) on the server side. The RTIP-32 FTP Client defaults to passive mode for best firewall compatibility. Use function ftpcli_mode after ftpcli_connect to use active mode. The FTP Client is an optional add-on for RTIP-32 and must be purchased in addition to RTIP-32 to be available. Applications requiring the FTP Client must include header file Ftpapi.h and link library Ftp.lib. The FTP Client API is documented in the RTIP-32 Reference Manual. Demo program FTPClient shows how to use this add-on.
|