The File Transfer Protocol (FTP) is a standart network protocol used for the transfer of computer files between a client and server on a computer network. FTP is built on a client-server model architecture and uses separate control and data connections between the client and the server.
FTP may run in active or passive mode, which determines how the data connection is established. In both cases, the client creates a TCP control connection from a random port to the FTP server command port 21.
-
In active mode, the client starts listening for incoming data connections from the server on port N. It sends the FTP command "PORT N" to inform the server on which port it is listening. The server then initiates a data channel to the client.
-
In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In this mode, the client uses the control connection to send the FTP command "PASV" to the server and then receives a server IP address and server port numbuer from server, which the client then uses to open a data connection.
- open hostname [ port ] - open new connection
- user username - send new user information
- cd remote-directory - change remote working directory
- ls [ remote-directory ] - print list of files in the remote directory
- put local-file [ remote-file ] - store a file at the server
- get remote-file [ local-file ] - retrieve a copy of the file
- pwd - print the current working directory name
- mkdir directory-name - make a directory on the remote machine
- rmdir directory-name - remove a directory
- del remote-file - delete a file
- binary - set binary transfer type
- size remote-file - show size of remote file
- stat [ remote-file ]- print server information
- syst - show remote system type
- noop - no operation
- close - close current connection
- help - print list of ftp commands
- exit - exit program
- Compiler support for C++17
- CMake 3.10 or newer
- Boost 1.67.0
- Python3 (only for tests)
- File Transfer Protocol – https://en.wikipedia.org/wiki/File_Transfer_Protocol
- RFC 959 File Transfer Protocol (FTP) Network Working Group J. Postel, J. Reynolds ISI October 1985