How FTP works

Read FTP reply codes

Use the three digits in an FTP reply to understand completion, connection, authentication, and filesystem results.

8 minute lesson

~~~

FTP replies have three digits followed by text. The first digit describes the broad result.

1xx means an operation has started and another reply will follow. 2xx means completion. 3xx needs more information. 4xx is a temporary failure. 5xx is a permanent failure for the request.

The second digit groups the subject: syntax, information, connections, authentication, or filesystem. For example, 150 opens a data transfer and 226 confirms that the transfer finished.

Read replies in command context:

C: STOR release.zip.part
S: 150 File status okay; opening data connection
...bytes move...
S: 452 Insufficient storage space

The preliminary 150 did not promise success. The final 452 says the upload failed temporarily after transfer started. Keep the local source and do not rename the remote temporary file into place.

Common evidence includes 220 for a service greeting, 331 for another authentication value, 425 when the data connection cannot open, 530 for login or account policy, and 550 for an unavailable file action.

Multiline replies use the same code with a hyphen until the final line uses a space. Read through the terminator before sending a decision based on an incomplete capability response.

For every failed operation, record the command, numeric reply, text, transfer mode, and whether a data connection opened. Classify the example above without reducing it to “upload failed.”

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →