D. J. Bernstein
Internet publication
FTP: File Transfer Protocol

The TYPE, STRU, and MODE verbs

The TYPE verb

The server keeps track of a binary flag for the client. At any moment, the binary flag is either on or off. At the beginning of the FTP connection, the binary flag is off.

While the binary flag is on, all RETR, STOR, APPE, and STOU requests are for binary files. While the binary flag is off, all RETR, STOR, APPE, and STOU requests are for text files. The binary flag has no effect on NLST and LIST.

A TYPE request controls the binary flag. It has a parameter. There are four possibilities for the parameter:

The server accepts the TYPE request with code 200.

RFC 959 requires that servers accept parameters in any combination of lowercase and uppercase, but I recommend that clients always use uppercase. RFC 959 also defined several more TYPE parameters, all of which are now obsolete.

The STRU verb

STRU is obsolete. The server should accept STRU F (in any combination of lowercase and uppercase) with code 200, and reject all other STRU attempts with code 504.

The MODE verb

MODE is obsolete. The server should accept MODE S (in any combination of lowercase and uppercase) with code 200, and reject all other MODE attempts with code 504.