D. J. Bernstein
Internet publication
FTP: File Transfer Protocol
The STOR, APPE, STOU, ALLO, MKD, RMD, DELE, RNFR, and RNTO verbs
The STOR verb
A STOR
request
asks the server to read the contents of a file
from the
data connection
already established by the client.
The STOR
parameter
is an
encoded pathname
of the file.
The file is either a
binary file
or a
text file,
depending on the most recent
TYPE request.
If the server is willing to create a new file under that name,
or replace an existing file under that name,
it responds with a
mark using
code
150.
It then stops accepting new connections,
attempts to read the contents of the file from the data connection,
and closes the data connection.
Finally it
- accepts the STOR request with code 226
if the entire file was successfully received and stored;
- rejects the STOR request with code 425
if no TCP connection was established;
- rejects the STOR request with code 426
if the TCP connection was established but then broken by the client
or by network failure; or
- rejects the STOR request with code 451, 452, or 552
if the server had trouble saving the file to disk.
The server may reject the STOR request (code 450, 452, or 553)
without first responding with a mark.
In this case the server does not touch the data connection.
Some servers allow
REST
immediately before STOR for binary files,
if a previous STOR for the same file
transmitted at least the number of bytes given by the
start position.
The APPE verb
APPE is just like STOR
except that, if the file already exists,
the server appends the client's data to the file.
The STOU verb
STOU is just like STOR
except that it asks the server
to create a file under a new pathname selected by the server.
The STOU parameter is optional;
if it is supplied,
it is a suggested pathname,
which the server will ignore if there is already a file with that pathname.
(RFC 959 prohibited STOU parameters, but this prohibition is obsolete.)
If the server accepts STOU,
it provides the pathname in a human-readable format
in the text of its response.
The ALLO verb
ALLO is obsolete.
The server should accept any ALLO request with code 202.
The MKD verb
A MKD request
asks the server to create a new
directory.
The MKD parameter
is an encoded pathname
specifying the directory.
If the server accepts MKD (required code 257),
its response includes the pathname of the directory,
in the same format used for responses to
PWD.
A typical server
accepts MKD with code 250 if the directory was successfully created,
or rejects MKD with code 550 if the creation failed.
RFC 1123 requires that the server treat XMKD as a synonym for MKD.
The RMD verb
An RMD request
asks the server to remove a directory.
The RMD parameter
is an encoded pathname
specifying the directory.
A typical server
accepts RMD with code 250 if the directory was successfully removed,
or rejects RMD with code 550 if the removal failed.
RFC 1123 requires that the server treat XRMD as a synonym for RMD.
The DELE verb
A DELE request
asks the server to remove a regular file.
The DELE parameter
is an encoded pathname
specifying the file.
A typical server
accepts DELE with code 250 if the file was successfully removed,
or rejects DELE with code 450 or 550 if the removal failed.
The RNFR verb
A RNFR request
asks the server to begin renaming a file.
The RNFR parameter
is an encoded pathname specifying the file.
A typical server
accepts RNFR with code 350 if the file exists,
or rejects RNFR with code 450 or 550 otherwise.
The RNTO verb
A RNTO request
asks the server to finish renaming a file.
The RNTO parameter
is an encoded pathname specifying the new location of the file.
RNTO must come immediately after RNFR;
otherwise the server may reject RNTO with code 503.
A typical server
accepts RNTO with code 250 if the file was renamed successfully,
or rejects RNTO with code 550 or 553 otherwise.