FTP reply code 226 is the success confirmation for file transfers. It is sent after the complete file data has been transmitted over the data connection and that connection is being closed. You will see 226 after RETR (download), STOR (upload), APPE (append), LIST (directory listing), and NLST (name list) operations complete. The response text may include the number of bytes transferred and the transfer speed. After 226, the data connection (port 20 or the passive mode port) is closed, but the control connection (port 21) remains open for further commands. If you sent a file and receive 226, the entire file was written to the server.
The client sent RETR and the server transmitted the entire file over the data connection. Code 226 confirms all bytes were sent and the data connection is closing. The client should verify the local file size matches the expected size.
The client sent STOR and transmitted the file to the server. Code 226 confirms the server received and stored the complete file. The upload is now safe and persistent on the server.
The client sent LIST or NLST and the server transmitted the directory listing over the data connection. Code 226 indicates the listing is complete and the data connection is closing.
After receiving 226 for a download, compare the local file size with the remote file size (use SIZE command). For critical files, compare checksums if the server supports HASH or XMD5 commands.
If you expected 226 but received 426 (Connection closed, transfer aborted) instead, the data connection was interrupted. Use REST and RETR to resume the download from where it stopped.
curl -C - -O ftp://ftp.example.com/file.zip
If transfers take a long time and you want to verify they are still active, send STAT on the control connection during the transfer. The server will report progress without interrupting the transfer.
The server is ready to transfer the file and is about to open the data connection.
The file or directory operation was completed successfully.
The server could not establish the data connection needed for the file transfer.
The data connection was closed unexpectedly and the file transfer was aborted.