FTP Commands
FTP commands sent across the control connection consist of simple text strings (and follow
the Telnet protocol - see RFC 854). For example, to retrieve a file, the client sends "RETR
filename" on the control connection to the FTP server. To transfer a file, the client sends
"STOR filename".
The FTP server acknowledges each command with an FTP reply, which consists of a three
digit number followed by human-readable text. The first digit indicates if the response is good,
bad, or incomplete. If an error occurred, the second digit may be used to indicate what type of
error occurred. Similarly, the third digit can indicate more details of the error.
The first digit is the most important, and the five possible values are described below:
Reply
|
Description
|
1yz
|
Positive Preliminary reply. The request action has been initiated, but another
reply is to be expected before the client issues another command.
|
2yz
|
Positive Completion reply. The requested action has successfully completed,
and the client may issue another command.
|
3yz
|
Positive Intermediate reply. The command has been accepted, but more
information is required. The client should send another command in reply.
|
4yz
|
Transient Negative reply. The command failed, but it can be retried.
|
5yz
|
Permanent Negative Completion reply. The command failed, and should not be
repeated.
|
Next: Sample Scenarios