About FTP Response Codes - KB Article #1444Related Articles -- 1445, 1446
Every FTP response includes a 3-digit code from the server in the format xyz. Each numeric response can be broken down into 3 parts based on the digits. The first digit is the category of the reply, the second digit is a more specific type of error, and the third digit is very specific, usually specific to the implementation of the server.
The three digits of the reply each have a special significance. This is intended to allow a range of very simple to very sophisticated responses by FTP. The first digit denotes whether the response is good, bad or incomplete. The second digit explains approximately what kind of error occurred (i.e. file system error, command syntax error). The third digit is reserved for the finest gradation of information (i.e., RNTO command without a preceding RNFR).
There are five values for the first digit of the reply code:
- 1yz Positive Preliminary reply
The requested action is being initiated; expect another reply before proceeding with a new command. This type of reply can be used to indicate that the command was accepted and the client may now pay attention to the data connections, for implementations where simultaneous monitoring is difficult. The server process may send at most one 1yz reply per command.
- 2yz Positive Completion reply
The requested action has been successfully completed. A new request may be initiated.
- 3yz Positive Intermediate reply
The command has been accepted, but the requested action is being held in abeyance, pending receipt of further information. The client should send another command specifying this information. This reply is used in command sequence groups.
- 4yz Transient Negative Completion reply
The command was not accepted and the requested action did not take place, but the error condition is temporary and the action may be requested again. The client should return to the beginning of the command sequence, if any. It is difficult to assign a meaning to "transient", particularly when two distinct particpants (server and client processes) have to agree on the interpretation. Each reply in the 4yz category might have a slightly different time value, but the intent is that the client process is encouraged to try again. A rule of thumb in determining if a reply fits into the 4yz or the 5yz (Permanent Negative) category is that replies are 4yz if the commands can be repeated without any change in command form or in properties of the client or server (e.g., the command is spelled the same with the same arguments used; the user does not change his file access or login name; the server does not put up a new implementation.)
- 5yz Permanent Negative Completion reply
The command was not accepted and the requested action did not take place. The client is discouraged from repeating the exact request (in the same sequence). Even some "permanent" error conditions can be corrected, so the user may want to direct his client to reinitiate the command sequence by direct action at some point in the future (e.g., after the spelling has been changed, or the user has altered his directory status.)
- 6yz Protected Reply
There are three reply codes of this type. The first, reply code 631, indicates an integrity protected reply. The second, reply code 632, indicates a confidentiality and integrity protected reply. The third, reply code 633, indicates a confidentiality protected reply.
The following are the meanings encoded in the second digit:
- x0z Syntax
These replies refer to syntax errors. These are syntactically correct commands that don't fit any functional category, unimplemented or superfluous commands.
- x1z Information
These are replies to requests for information, such as status or help.
- x2z Connections
Replies referring to the control and data connections.
- x3z Authentication and accounting
Replies related to the login process and accounting procedures.
- x4z Unspecified
This response code is not currently used, but has been reserved for the future needs of the FTP protocol.
- x5z File system
These replies indicate the status of the server file system regarding the requested transfer or other file system action.