Xceed .NET Libraries Documentation
FTP commands
Welcome to Xceed .NET, .NET Standard and Xamarin Libraries! > Basic Concepts > FTP capabilities > FTP glossary > FTP commands

A set of commands that comprise the control information flowing from the client to the server process. The information regarding each FTP command listed below was taken from the FTP RFC

This list applies to the FtpClient and AsyncFtpClient classes only.

AsyncFtpClient's methods now call the corresponding synchronous methods on a background thread. For this reason, the AsyncFtpClient class is now considered obsolete. It is therefore recommended to use FtpClient and assign a SynchronizingObject to its SynchronizingObject property to improve code readability.
Code Command FtpClient method/property AsyncFtpClient method/property Description
ABOR Abort Abort method
 
BeginAbort method This command tells the server to abort the previous FTP service command and any associated transfer of data.
ACCT Account Login method
 
BeginLogin method The argument field is a string identifying the user's account. The command is not necessarily related to the USER command, as some sites may require an account for login and others only for specific access, such as storing files. In the latter case the command may arrive at any time.
ALLO Allocate PreAllocateStorage property PreAllocateStorage property This command may be required by some servers to reserve sufficient storage to accommodate the new file to be transferred. The argument shall be a decimal integer representing the number of bytes of storage to be reserved for the file.
APPE Append (with create) SendFile method BeginSendFile method This command causes the server to accept the data transferred via the data connection and to store the data in a file at the server site. If the file specified in the pathname exists at the server site, then the data shall be appended to that file; otherwise the file specified in the pathname shall be created at the server site.
AUTH Authenticate Authenticate method BeginAuthenticate method The argument field is a string identifying a supported mechanism.   This string is case-insensitive.   Values must be registered with the IANA, except that values beginning with "X-" are reserved for local use.
CCC Clear command channel ClearCommandChannel method ClearCommandChannel method This command clears the command channel after login to facilitate firewall NAT when connecting using a secure data channel.
CDUP Change to parent directory ChangeToParentFolder method BeginChangeToParentFolder method This command is a special case of CWD , and is included to simplify the implementation of programs for transferring directory trees between operating systems having different syntaxes for naming the parent directory.
CWD Change working directory ChangeCurrentFolder method BeginChangeCurrentFolder method This command allows the user to work with a different directory or dataset for file storage or retrieval without altering his login or accounting information. Transfer parameters are similarly unchanged. The argument is a pathname specifying a directory or other system dependent file group designator.
DELE Delete DeleteFile method BeginDeleteFile method This command causes the file specified in the pathname to be deleted at the server site.
HELP Help SendCustomCommand method BeginSendCustomCommand method This command shall cause the server to send helpful information regarding its implementation status over the control connection to the user. The command may take an argument (e.g., any command name) and return more specific information as a response.
LIST List GetFolderContents and GetRawFolderContents methods. BeginGetFolderContents and BeginGetRawFolderContents methods This command causes a list to be sent from the server to the passive data transfer process. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current information on the file. A null argument implies the user's current working or default directory.
MKD Make directory CreateFolder method BeginCreateFolder method This command causes the directory specified in the pathname to be created as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
MODE Transfer mode SendCustomCommand method BeginSendCustomCommand method The argument is a single character code specifying the data transfer modes.
 
The following codes are assigned for transfer modes:
 
                S - Stream
                B - Block
                C - Compressed
 
The default transfer mode is Stream.
NLST Name list GetFolderContents and GetRawFolderContents methods. BeginGetFolderContents and BeginGetRawFolderContents methods This command causes a directory listing to be sent from server to user site. The pathname should specify a directory or other system-specific file group descriptor; a null argument implies the current directory. The server will return a stream of names of files and no other information.
NOOP No operation SendCustomCommand method and KeepAliveInterval property. BeginSendCustomCommand method and KeepAliveInterval property. This command does not affect any parameters or previously entered commands. It specifies no action other than that the server send an OK reply.
PASS Password Login method BeginLogin method The argument field is a string specifying the user's password. This command must be immediately preceded by the user name command, and, for some sites, completes the user's identification for access control.
PASV Passive PassiveTransfer property PassiveTransfer property This command requests the server to "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. The response to this command includes the host and port address this server is listening on.
PORT Data port PassiveTransfer property PassiveTransfer property The argument is a HOST-PORT specification for the data port to be used in data connection. There are defaults for both the user and server data ports, and under normal circumstances this command and its reply are not needed. If this command is used, the argument is the concatenation of a 32-bit internet host address and a 16-bit TCP port address. This address information is broken into 8-bit fields and the value of each field is transmitted as a decimal number (in character string representation). The fields are separated by commas. A port command would be:
 
PORT h1,h2,h3,h4,p1,p2
 
where h1 is the high order 8 bits of the internet host address.
PROT Data Channel Protection Level Authenticate method BeginAuthenticate method The argument is a single character code specifying the data channel protection level. This command indicates to the server what type of data channel protection the client and server will be using.   The following codes are assigned:
          C - Clear
          S - Safe
          E - Confidential
          P - Private
PWD Print working directory SendCustomCommand
or GetCurrentFolder methods
BeginSendCustomCommand and BeginGetCurrentFolder methods This command causes the name of the current working directory to be returned in the reply.
QUIT Logout Disconnect method BeginDisconnect method This command terminates a USER and if file transfer is not in progress, the server closes the control connection. If file transfer is in progress, the connection will remain open for result response and the server will then close it. If the user-process is transferring files for several USERs but does not wish to close and then reopen connections for each, then the REIN command should be used instead of QUIT.
 
An unexpected close on the control connection will cause the server to take the effective action of an abort (ABOR) and a logout (QUIT).
REIN Reinitialize ChangeUser method BeginChangeUser method This command terminates a USER, flushing all I/O and account information, except to allow any transfer in progress to be completed. All parameters are reset to the default settings and the control connection is left open. This is identical to the state in which a user finds himself immediately after the control connection is opened. A USER command may be expected to follow.
REST Restart SendFile method BeginSendFile method The argument field represents the server marker at which file transfer is to be restarted. This command does not cause file transfer but skips over the file to the specified data checkpoint. This command shall be immediately followed by the appropriate FTP command which shall cause file transfer to resume.
RETR Retrieve ReceiveFile and ReceiveMultipleFiles methods BeginReceiveFile and BeginReceiveMultipleFiles methods This command causes the server   to transfer a copy of the file, specified in the pathname, to the server or client at the other end of the data connection. The status and contents of the file at the server site shall be unaffected.
RMD Remove directory DeleteFolder method BeginDeleteFolder method This command causes the directory specified in the pathname to be removed as a directory (if the pathname is absolute) or as a subdirectory of the current working directory (if the pathname is relative).
RNFR Rename from RenameFile method BeginRenameFile method This command specifies the old pathname of the file which is to be renamed. This command must be immediately followed by a "rename to" command specifying the new file pathname.
RNTO Rename to RenameFile method BeginRenameFile method This command specifies the new pathname of the file specified in the immediately preceding "rename from" command. Together the two commands cause a file to be renamed.
SITE Site parameters SendCustomCommand method BeginSendCustomCommand method This command is used by the server to provide services specific to his system that are essential to file transfer but not sufficiently universal to be included as commands in the protocol. The nature of these services and the specification of their syntax can be stated in a reply to the HELP SITE command.
SMNT Structure mount SendCustomCommand method BeginSendCustomCommand method This command allows the user to mount a different file system data structure without altering his login or accounting information. Transfer parameters are similarly unchanged. The argument is a pathname specifying a directory or other system dependent file group designator.
STAT Status SendCustomCommand method BeginSendCustomCommand method This command shall cause a status response to be sent over the control connection in the form of a reply. The command may be sent during a file transfer in which case the server will respond with the status of the operation in progress, or it may be sent between file transfers.
STOR Store SendFile and SendMultipleFiles methods BeginSendFile and BeginSendMultipleFiles methods This command causes the server to accept the data transferred via the data connection and to store the data as a file at the server site. If the file specified in the pathname exists at the server site, then its contents shall be replaced by the data being transferred. A new file is created at the server site if the file specified in the pathname does not already exist.
STOU Store unique SendFileToUniqueName method BeginSendFileToUniqueName method This command behaves like STOR except that the resultant file is to be created in the current directory under a name unique to that directory.
STRU File structure SendCustomCommand method BeginSendCustomCommand method The argument is a single character code specifying file structure.
 
The following codes are assigned for structure:
 
                F - File (no record structure)
                R - Record structure
                P - Page structure
 
The default structure is File.
SYST System SendCustomCommand method BeginSendCustomCommand method This command is used to find out the type of operating system at the server.
TYPE Representation type RepresentationType property RepresentationType property The argument specifies the representation type. Several types take a second parameter. The first parameter is denoted by a single character, as is the second Format parameter for ASCII and EBCDIC; the second parameter for local byte is a decimal integer to indicate Bytesize. The parameters are separated by a <SP> (Space, ASCII code 32).
 
The following codes are assigned for type:
 
                         \     /
                A - ASCII |     | N - Non-print
                         |-><-| T - Telnet format effectors
                E - EBCDIC|     | C - Carriage Control (ASA)
                         /     \
                I - Image
               
                L <byte size> - Local byte Byte size
 
The default representation type is ASCII Non-print. If the Format parameter is changed, and later just the first argument is changed, Format then returns to the Non-print default.
USER Username Login method BeginLogin method The argument field is a string identifying the user. The user identification is that which is required by the server for access to its file system. This command will normally be the first command transmitted by the user after the control connections are made (some servers may require this). Additional identification information in the form of a password and/or an account command may also be required by some servers. Servers may allow a new USER command to be entered at any point in order to change the access control and/or accounting information. This has the effect of flushing any user, password, and account information already supplied and beginning the login sequence again. All transfer parameters are unchanged and any file transfer in progress is completed under the old access control parameters.