Transfer behavior

ASCII and binary transfer types

Use TYPE I for byte-for-byte transfers and understand the historical newline conversion performed by TYPE A.

8 minute lesson

~~~

TYPE A is ASCII mode. It can translate text line endings between the local system and the network representation.

TYPE I is image mode, commonly called binary mode. It transfers bytes without text newline conversion and is the safe default for images, archives, executables, PDFs, and most modern files.

Using ASCII mode on a binary file can corrupt it. Modern clients commonly select binary automatically, but verify the setting in automation and old interactive clients.

The client sets transfer representation before the data command:

C: TYPE I
S: 200 Type set to I
C: RETR database.sqlite

Image mode does not mean the file is an image. It means an uninterpreted sequence of bytes. Use it for nearly every modern transfer, including UTF-8 text, unless a legacy system explicitly requires network-text conversion.

ASCII mode can map local line endings to FTP’s network representation and back. A retry across different systems can therefore produce content with different bytes even when the visible text looks similar.

Size and restart offsets can depend on the selected representation. Set TYPE I before comparing byte sizes or resuming a binary transfer.

Transfer one small text file in both modes between systems with different newline conventions. Compare cryptographic hashes and explain the difference.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →