Topic Path: Symbol Reference > Structs, Records, Enums > TIdFTPTransferMode Enumeration
ContentsIndexHome
PreviousUpNext
TIdFTPTransferMode Enumeration

Represents the data transmission mode for an FTP session.

File
TIdFTPTransferMode = (
  dmStream,
  dmDeflate
);

TIdFTPTransferMode is an enumerated type that represents the data transmission mode for an FTP session. TIdFTPTransferMode includers the following enumeration values and meanings: 

 

Value 
Meaning 
dmStream 
Data is transmitted as a stream of bytes. 
dmDeflate 
Data is transmitted as a compressed stream of bytes. 
dmBlock 
Unused. 
dmCompressed 
Unused. 

 

dmBlock and dmCompressed transmission modes were removed because we don't use them and they aren't supported on most FTP Servers. 

Transmission mode values are often used in conjunction with data structure values represented by TIdFTPDataStructure. This enables determining both the format and the processing required for data sent in record-structured FTP protocol exchanges. For file-structured protocol exchanges, EOF is indicated by the sending host closing the data connection and all bytes are data bytes. 

For Block mode transmissions (dmBlock), the file is transmitted as a series of data blocks preceded by one or more header bytes. The header bytes contain a count field, and descriptor code. The count field indicates the total length of the data block in bytes, thus marking the beginning of the next data block (there are no filler bits). The descriptor code defines: last block in the file (EOF) last block in the record (EOR), restart marker (see the Section on Error Recovery and Restart) or suspect data (i.e., the data being transferred is suspected of errors and is not reliable). This last code is NOT intended for error control within FTP. It is motivated by the desire of sites exchanging certain types of data (e.g., seismic or weather data) to send and receive all the data despite local errors (such as "magnetic tape read errors"), but to indicate in the transmission that certain portions are suspect). Record structures are allowed in this mode, and any representation type may be used. 

For Compressed mode transmissions (dmCompressed), there are three kinds of information to be sent: regular data, sent in a byte string; compressed data, consisting of replications or filler; and control information, sent in a two-byte escape sequence. If n>0 bytes (up to 127) of regular data are sent, these n bytes are preceded by a byte with the left-most bit set to 0 and the right-most 7 bits containing the number n. 

A string of n filler bytes can be compressed into a single byte, where the filler byte varies with the representation type. If the type is ASCII or EBCDIC the filler byte is Space (ASCII code 32, EBCDIC code 64). If the type is Image or Local byte the filler is a zero byte. 

The escape sequence is a double byte, the first of which is the escape byte (all zeros) and the second of which contains descriptor codes as defined in Block mode. The descriptor codes have the same meaning as in Block mode and apply to the succeeding string of bytes. 

Compressed mode is useful for obtaining increased bandwidth on very large network transmissions at a little extra CPU cost. It can be most effectively used to reduce the size of printer files such as those generated by RJE hosts.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.