5.4. Command and response sequence
Communication between the server and the user is a dialogue process. The user sends an FTP command, waits for one or more responses from the server, and then sends a new command based on the response.
Connection
The response contains a lot of information. Normally, the server returns a 220 response and waits for the input. After receiving the response, the user sends a new command. If the server cannot receive the input immediately, after 220
Returns the value 120. For example, if the server stops working after 15 minutes, the server sends messages to the user, but the server cannot send messages directly to the user. The message is buffered and returned in the next response.
Return to the user. The following lists the command responses. The first is the prepared response, the second is the final response, the third is the rejected response, and the third is the intermediate response. These responses form the basis of the status chart, which will be shown in the following section.
Given:
120
220
220
421
- User
230
530
500,501,421
331,332
- Pass
230
202
530
500,501,503,421
332
- Acct
230
202
530
500,501,503,421
- CWD
250
500,501,502,421,530,550
- Cdup
200
500,501,502,421,530,550
- SMNT
202,250
500,501,502,421,530,550
- Rein
120
220
220
421
500,502
- Quit
221
500
- Port
200
500,501,421,530
- PASV
227
500,501,502,421,530
- Mode
200
500,501,504,421,530
- Type
200
500,501,504,421,530
- Stru
200
500,501,504,421,530
Allo
200
202
500,501,504,421,530
Rest
500,501,502,421,530
350
Stor
125,150
(110)
226,250
425,426,451,551,552
532,450,452,553
500,501,421,530