File Transfer Protocol (Ftp:file Transfer Protocol) allows files to be shared between hosts. FTP uses TCP to generate a virtual connection to control information and then generate a separate TCP connection for data transfer. Control connections use similar TELNET protocols to Exchange commands and messages between hosts.
The main functions of FTP are as follows:
Provides sharing of files (computer programs/data), supports the indirect use of remote computers, and users are not affected by the differences between different types of host file memory systems; reliable and efficient transmission of data.
FTP, although it can be directly used by end users, but its application is mainly through the implementation of the program.
The FTP control frame refers to Telnet exchange information, including Telnet commands and options. However, most FTP control frames are simple ASCII text that can be divided into FTP commands or FTP messages. An FTP message is a response to an FTP command that consists of an answer code with interpreted text.
Protocol structure
Command |
Describe |
Abor |
Interrupt Data Connection Program |
ACCT <account> |
System Privileged Account |
ALLO <bytes> |
Allocating bytes to file storage on the server |
AppE <filename> |
Add file to server file with same name |
Cdup <dir path> |
Change the parent directory on the server |
CWD <dir path> |
Change the working directory on the server |
DELE <filename> |
Delete the specified file on the server |
Help <command> |
Returns the specified command information |
LIST <name> |
If it is a filename, list file information and, if it is a directory, lists the files |
MODE <mode> |
Transfer mode (s= flow mode, b= block mode, c= compression mode) |
MKD <directory> |
Set up the specified directory on the server |
NLST <directory> |
Lists the contents of the specified directory |
NOOP |
No action, except recognition from the server |
Pass <password> |
System Login Password |
PASV |
Requesting a server to wait for a data connection |
PORT <address> |
IP address and two-byte port ID |
Pwd |
Show Current working directory |
QUIT |
To exit the login from the FTP server |
REIN |
Reinitialize Login Status Connection |
REST <offset> |
Restart file delivery by a specific offset |
RETR <filename> |
Retrieve (copy) a file from the server |
RMD <directory> |
Delete the specified directory on the server |
RNFR <old path> |
renaming old paths |
Rnto <new path> |
Renaming the new Path |
SITE <params> |
Site-specific parameters provided by the server |
Smnt <pathname> |
Mount the specified file structure |
STAT <directory> |
Returns information on the current program or directory |
STOR <filename> |
Save (copy) files to the server |
Stou <filename> |
Save file to server name |
Stru <type> |
Data structure (f= file, r= record, p= page) |
Syst |
Return to the operating system used by the server |
TYPE <data type> |
Data type (a=ascii,e=ebcdic,i=binary) |
USER <username>> |
User name for System login |
The standard FTP information is as follows:
Response code |
Explanatory notes |
110 |
Restart mark on new file indicator |
120 |
Server readiness Time (in minutes) |
125 |
Open data connection, start transmission |
150 |
Open connection |
200 |
Success |
202 |
Command not executed |
211 |
System Status Reply |
212 |
Directory Status reply |
213 |
File status reply |
214 |
Help message reply |
215 |
System type Reply |
220 |
Service Ready |
221 |
Exit Network |
225 |
Open Data Connection |
226 |
End data Connection |
227 |
Enter passive mode (IP address, ID Port) |
230 |
Log on to the Internet |
250 |
File Behavior complete |
257 |
Path name creation |
331 |
Password required |
332 |
Request account Number |
350 |
File Behavior paused |
421 |
Service shutdown |
425 |
Unable to open data connection |
426 |
End Connection |
450 |
File not available |
451 |
Local error encountered |
452 |
Low disk space |
500 |
Invalid command |
501 |
Error parameters |
502 |
Command not executed |
503 |
Error instruction sequence |
504 |
Invalid command arguments |
530 |
Network not logged in |
532 |
Storage file requires account number |
550 |
File not available |
551 |
Type of page not known |
552 |
Storage allocation exceeded |
553 |
File name not allowed |