Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kench1994/ftp-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Transfer Protocol (FTP)

OSS Builds Status:

Build Status

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.

Communication and data transfer

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.

Available commands

  1. open hostname [ port ] - open new connection
  2. user username - send new user information
  3. cd remote-directory - change remote working directory
  4. ls [ remote-directory ] - print list of files in the remote directory
  5. put local-file [ remote-file ] - store a file at the server
  6. get remote-file [ local-file ] - retrieve a copy of the file
  7. pwd - print the current working directory name
  8. mkdir directory-name - make a directory on the remote machine
  9. rmdir directory-name - remove a directory
  10. del remote-file - delete a file
  11. binary - set binary transfer type
  12. size remote-file - show size of remote file
  13. stat [ remote-file ]- print server information
  14. syst - show remote system type
  15. noop - no operation
  16. close - close current connection
  17. help - print list of ftp commands
  18. exit - exit program

Requirements

  • Compiler support for C++17
  • CMake 3.10 or newer
  • Boost 1.67.0
  • Python3 (only for tests)

References

About

Implementation of a simple FTP client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.0%
  • CMake 3.6%
  • Python 1.8%
  • Other 1.6%