Skip to content

Supported FTP commands

HELP and FEAT list what the server supports. The command names are not case sensitive.

Login and security

Command Meaning
USER <name> Start the login as <name>.
PASS <password> The password of the user.
ACCT Not implemented (502).
AUTH TLS Switch the control connection to TLS (explicit FTPS, RFC 4217). Needs a build with OpenSSL.
PBSZ 0 Protection buffer size, required by TLS and accepted with 0.
PROT C, PROT P Data connection in clear text (C) or protected by TLS (P).
CCC Switch the control connection back to clear text.
QUIT Close the connection.

Information

Command Meaning
FEAT The extensions of the server.
OPTS Options of an extension: OPTS UTF8 ON, OPTS MLST <facts>.
SYST Type of the system (UNIX Type: L8).
HELP The list of commands.
NOOP Does nothing; keeps the connection open.
STAT Without argument, the status of the connection. With a path, the listing of the path on the control connection.
LANG Language of the replies (RFC 2640): English only.
HOST Accepted and ignored: uFTP has no virtual hosts (RFC 7151).
Command Meaning
PWD, XPWD The current directory.
CWD <path> Change directory.
CDUP, XCUP Go to the parent directory.
LIST [path] Detailed listing: permissions, owner, group, size, date.
NLST [path] Names only.
MLSD [path] Machine readable listing of a directory (RFC 3659).
MLST [path] The same facts of one file or directory, on the control connection.

OPTS MLST type;size;modify;perm;unix.mode;unix.uid;unix.gid chooses the facts of MLST and MLSD.

Transfers

Command Meaning
PASV, EPSV Passive mode: the server opens a port and the client connects (EPSV carries only the port; EPSV ALL refuses the other modes).
PORT, EPRT Active mode: the server connects to the address of the client.
TYPE A, TYPE I Accepted; the data is always transferred as binary (no line end conversion).
STRU F, STRU R File structure (default) or record structure in stream mode. STRU P is not implemented.
MODE S Stream mode. Other modes answer 504.
RETR <path> Download a file.
STOR <path> Upload a file.
APPE <path> Append to a file.
REST <offset> Resume a download or an upload from a byte offset.
ABOR Abort the transfer in progress.
ALLO Accepted and ignored (202).

Files and directories

Command Meaning
SIZE <path> The size of a file in bytes.
MDTM <path> The modification time of a file.
MKD <path>, XMKD Create a directory.
RMD <path>, XRMD Remove a directory.
DELE <path> Delete a file.
RNFR <path>, RNTO <path> Rename: RNFR names the source and RNTO the target.
SITE CHMOD <mode> <path> Change the permissions of a file. The setuid and setgid bits are refused, and you must be allowed to write the file.
SITE HELP The list of the SITE commands.

Reply codes you may see

Code Meaning
150 The data connection is open, the transfer starts.
226 The transfer is complete.
250 The command worked.
421 The server is full, or the limit of connections or of connections per minute is reached.
425 The data connection could not be opened.
426 The transfer was interrupted.
450 Temporary error: for instance the directory of an upload is still being created by another connection. The client can retry.
452 The disk is below MIN_FREE_SPACE_MB.
530 Not logged in, or wrong user name or password.
550 The file or directory does not exist or you are not allowed to use it.