Kermit FAQ - Binary Files Are Corrupted After Transfer

(Home) (Prev) (Next)

12 Binary Files Are Corrupted After Transfer

Some non-Columbia Kermit implementations simply do not work, including some found in BBS software. For example, if you download a file from a BBS using their Kermit protocol option and find a lot of Ctrl-Ys in your file where only actual letter Y's should be, then the BBS has a broken Kermit implementation. The same is also true if a file downloaded from a BBS in binary mode is bigger than the original. Ask your BBS sysop to install MS-DOS Kermit ("Kermit Lite") as an external protocol. See the KERMIT.UPD file in the MS-DOS Kermit 3.14 distribution for additional information.

The more common cause, however, for "corrupted" binary files is that they were transferred in text mode.

Both Kermit and ftp transfer files in text mode by default. This means that record formats and character sets are likely to be converted. You can tell Kermit to skip all conversions and transfer the file literally, as-is, with the command:

  SET FILE TYPE BINARY
Normally, it is sufficient to give this command to the FILE SENDER before giving it the SEND command. But there are some exceptions to this rule:
  1. One or both Kermits do not support "Attribute packets" (or they are disabled). This is true of many of the commercial and shareware Kermit implementations. Cure: tell BOTH Kermits to use binary mode.
  2. You are using some combination of C-Kermit 5A(190) or later, MS-DOS Kermit 3.14 or later, or IBM Mainframe Kermit 4.3.1 or later in client server mode. In this case, it is the CLIENT's file type setting, rather than the file sender's, that prevails. Cure: tell the CLIENT to SET FILE TYPE BINARY, or to be extra sure, tell them both.
  3. You are sending the file from VMS C-Kermit, which is unique among Kermit programs in its ability to automatically switch between text and binary mode based on the file's characteristics. VMS C-Kermit ignores SET FILE TYPE BINARY and SET FILE TYPE TEXT when sending files, and instead uses binary mode if the file's record format is Fixed, and text mode otherwise. However, some binary files, notably VMS ZIP files, are stored using a "text-style" record format (Stream_LF), so Kermit sends them in text mode. You can override this by telling it to SET FILE TYPE IMAGE.

If you follow all these directions and binary transfers still come out wrong, then perhaps the file you were downloading was corrupt to begin with -- e.g. it was ftp'd in text mode instead of binary mode.


Kermit FAQ / Columbia University / kermit@kermitproject.org