FTP
Click on the red underlined text to get to the source
...
This document updates the File Transfer Protocol (FTP) [3]. Four new
commands are added: "SIZE", "MDTM ...
... particular, the terms "reply", "user", "NVFS" (Network Virtual File
System), "file", "pathname", "FTP commands", "DTP" (data transfer
process), "user-FTP process ...
... FTP commands", "DTP" (data transfer
process), "user-FTP process", "user-PI" (user protocol interpreter),
"user-DTP ...
... user-PI" (user protocol interpreter),
"user-DTP", "server-FTP process", "server-PI", "server-DTP", "mode",
...
... in which it is used. In some cases it will be a value from a set of
possible values maintained elsewhere. In others it might be a string
invented by one party to an FTP conversation from whatever sources it
finds relevant.
...
... ABNF, string literals are case insensitive. That
convention is preserved in this document, and implies that FTP
commands added by this specification have names that can be
represented in any case. That is, "MDTM" is the same as "mdtm",
...
...
Various FTP commands take pathnames as arguments, or return pathnames
in responses. When the MLST command is supported, as indicated in
...
... Unless otherwise specified, the pathname is terminated by the CRLF
that terminates the FTP command, or by the CRLF that ends a reply.
Any trailing spaces preceding that CRLF ...
... data connection. Data connections only contain
file names transmitted from server-FTP to user-FTP as the result of
one of the directory listing commands. Files with names containing
...
... Data connections only contain
file names transmitted from server-FTP to user-FTP as the result of
one of the directory listing commands. Files with names containing
the CRLF ...
... CRLF, or be omitted from the listing.
Implementations should also beware that the FTP control connection
uses Telnet ...
... equality) between the pathname given and the files present in the
NVFS of the server-FTP is permitted.
Clients ...
... GMT, TAI, UTC, UT1, UT2, etc., are
not considered here. A server-FTP process should always use the same
time reference, so the times it returns will be consistent. Clients
...
... 3] defines the format and meaning of replies by the
server-PI to FTP commands from the user-PI. Those reply conventions
are used here without change.
...
... Implementors should note that the ABNF syntax used in this document
and in other FTP related documents (but not used in [3]), sometimes
shows replies using the one-line format. Unless otherwise explicitly
...
... not permitted. Implementors should assume that, unless stated to the
contrary, any reply to any FTP command (including QUIT) may use the
multi-line format described in [3].
...
...
In the examples of FTP dialogs presented in this document, lines that
begin "C> " were sent over the control connection from the user-PI ...
... when a file in the server NVFS was last modified. This command has
existed in many FTP servers for many years, as an adjunct to the REST
command for STREAM mode ...
...
When attempting to restart a RETRieve, the user-FTP can use the MDTM
command or the "modify" fact to check if the modification time of the
...
... RESTart. If they differ, the files may have changed, and RESTart
would be inadvisable. Where this is not possible, the user-FTP
should make sure to allow for possible clock skew when comparing
times.
...
...
When attempting to restart a STORe, the User FTP can use the MDTM
command to discover the modification time of the partially
...
... CRLF
As with all FTP commands, the "MDTM" command label is interpreted in
a case-insensitive ...
... When replying to the FEAT command [6], a server-FTP process that
supports the MDTM command MUST include a line containing the single
...
...
The FTP command, SIZE OF FILE (SIZE), is used to obtain the transfer
size of a file from the server-FTP process ...
... FTP command, SIZE OF FILE (SIZE), is used to obtain the transfer
size of a file from the server-FTP process. This is the exact number
of octets (8 bit bytes) that would be transmitted over the data
connection ...
... When replying to the FEAT command [6], a server-FTP process that
supports the SIZE command MUST include a line containing the single
word "SIZE". This word is case insensitive, and MAY be sent in any
...
... inserted into the data stream, they would be indistinguishable from
data. For this reason, the FTP specification [3] did not provide the
ability to do restarts ...
... more effort will be required, but it remains always possible to
determine the offset with finite, but perhaps non-negligible, effort.
In the worst case, an FTP process may need to open a data connection
to itself, set the appropriate transfer type and structure, and
...
... actually transmit the file, counting the transmitted octets.
If the user-FTP process is intending to restart a retrieve, it will
directly calculate the restart ...
... restart marker and send that information in
the RESTart command. However, if the user-FTP process is intending
to restart sending the file, it needs to be able to determine how
...
... restart sending the file, it needs to be able to determine how
much data was previously sent, and correctly received and saved. A
new FTP command is needed to get this information. This is the
purpose of the SIZE command, as documented in section 4.
...
...
That which has so far been described is perfectly consistent with the
standard FTP NVFS and access mechanisms. The "CWD" command is used
...
...
However, it is often useful to be able to reference files other than
by changing directories, especially as FTP provides no guaranteed
mechanism to return to a previous directory. The Trivial Virtual
File Store (TVFS ...
... valid to reference the file from the
directory containing the name, that is, when that directory is the
server-FTP's current working directory.
...
... to as a "relative pathname" and will only correctly reference the
intended file when the current working directory of the server-FTP is
a directory from which the relative pathname is valid.
...
... + While any legal IS10646 character is permitted to occur in a TVFS
file or directory name, other than "/", server FTP implementations
are not required to support all possible IS10646 characters. The
...
...
The TVFS feature adds no new commands to the FTP command repertoire.
...
...
If the current working directory of the server-FTP is /A then the
following pathnames, in addition to all the fully qualified
pathnames, are valid ...
...
Any of those could be made valid by changing the server-FTP's current
working directory to the appropriate directory. Note that the paths
"P" and "Q" might refer to different files depending upon which
...
... MLSD commands are intended to standardize the file and
directory information returned by the server-FTP process. These
commands differ from the LIST command in that the format of the
replies is strictly defined although extensible.
...
... character sets which are 8-bit, but specifying that
FTP implementations are to specifically allow the transmission and
reception of 8-bit bytes, with all bits ...
... If the Client-FTP sends an invalid argument, the server-FTP MUST
reply with an error code of 501.
...
... connection
as if the "TYPE L 8", "MODE S", and "STRU F" commands had been given,
whatever FTP transfer type, mode and structure had actually been set,
and without causing those settings to be altered for future commands.
That is, this transfer type shall be set for the duration of the data
connection ...
... UTF-8 encoded file
names. FTP implementations SHOULD use UTF-8 whenever possible to
encourage the maximum inter-operability.
...
...
Further information about file name encoding for FTP may be found in
"Internationalization of the File Transfer Protocol ...
... returned.
If the server-FTP process is able, and the "type" fact is being
returned, it MAY return in the MLSD response, an entry whose type is
...
... pathname that is valid to refer to that directory from the current
working directory of the server-FTP. Where more than one name
exists, multiple of these entries may be returned. In a sense, the
"cdir" entry can be viewed as a heading for the MLSD ...
... Where TVFS is supported by the server-FTP, this name may be used to
construct pathnames with which to refer to the files and directories
returned in the same MLSD ...
... of the listed directory. If the listed directory is the current
directory, a CDUP command may also have the effect of changing to the
named directory. User-FTP processes should note not all responses
will include this information, and that some systems may provide
multiple type=pdir responses.
...
... unique identifier for a file or
directory in the NVFS accessed via a server-FTP process. The value
of this fact should be the same for any number of pathnames that
refer to the same underlying file. The fact should have different
...
...
The perm fact is used to indicate access rights the current FTP user
has over the object listed. Its value is always an unordered
sequence of alphabetic characters.
...
...
Implementation note: The permissions are described here as they apply
to FTP commands. They may not map easily into particular
permissions available on the server's operating system. Servers
...
...
Given limitations in some systems, Client-FTP implementations must
understand this size may not be precise and may change between the
time of a MLST ...
... IANA guidelines>
Server-FTP implementations MUST NOT guess media type values. Media
type values must be determined in an unambiguous way such as file
system ...
... character set
is UTF-8 unless specified otherwise. FTP implementations SHOULD use
UTF-8 if possible to encourage maximum inter-operability. The value
...
...
The following examples are all taken from dialogues between existing
FTP clients and servers. Because of this, not all possible
variations of possible response formats ...
... available via standard MLST facts, it is sufficient for the purposes
of FTP to note that all represent the same file, and that the same
data would be fetched no matter which of them was retrieved, and that
all would be simultaneously modified were data stored in any.
...
... S> 250 End
In this example, the server-FTP is indicating that "file1" was last
modified 237 milliseconds after 00:33:55 UTC on the 29th of
...
... independent. Clients may issue this command in any case, or
combination of cases, they desire. This is the case for all FTP
commands.
C> MlsD
...
...
Next, notice the labels of the facts. These are also case-
independent strings; the server-FTP is permitted to return them in
any case desired. User-FTP must be prepared to deal with any case,
...
... independent strings; the server-FTP is permitted to return them in
any case desired. User-FTP must be prepared to deal with any case,
though it may do this by mapping the labels to a common case if
desired.
...
... the FEAT command, two spaces are not permitted. If no factlist is
given, then the server-FTP process is indicating that it supports
MLST, but implements no facts. Only pathnames can be returned. This
...
... For the MLSx commands, the Client-FTP may specify a list of facts it
wishes to be returned in all subsequent MLSx commands until another
...
... containing a syntax error (spaces cannot appear in the factlist.)
The server-FTP sends an error response and completely ignores the
request, leaving the fact set selected as it had been previously.
...
... Impact on Other FTP Commands ...
...
Along with the introduction of MLST, traditional FTP commands must be
extended to allow for the use of more than US-ASCII [1 ...
... protocol elements, and are always expressed in
ASCII. FTP responses are composed of the numeric code, which is a
protocol element, and a message, which is often expected to convey
...
... information to the user. It is not expected that users normally
interact directly with the protocol elements, rather the user-FTP
process constructs the commands, and interprets the results, in the
manner best suited for the particular user. Explanatory text in
responses generally has no particular meaning to the protocol. The
...
...
No restrictions at all are placed upon the contents of files
transferred using the FTP protocols. Unless the "media-type" fact is
provided in a MLSx ...
... that any of the mechanisms documented here impact in any particular
way upon the security of FTP.
Implementing the SIZE command, and perhaps some of the facts of the
...
... difficulties.
The server-FTP should take care not to reveal sensitive information
about files to unauthorised parties. In particular, some underlying
filesystems provide a file identifier ...
... Postel, J. and J. Reynolds, "File Transfer Protocol (FTP)", STD 9, RFC 959std9, October 1985. ...
... commands, edited by David Borman, has been merged with this document.
Mike Gleason, Alun Jones and Luke Mewburn provided access to FTP
servers used in some of the examples.
...
