NIU Department of Mathematical Sciences
Exchanging Files by E-mail

STUCK? SEARCH INDEX MAIN

Contents

Encoding binary files
Sending files by e-mail
Receiving encoded files
Word processing documents

Most e-mail systems transmit only the basic ASCII character set, which is the lowest common denominator in the computer world. However, you will often need to send (or receive) a file in a different format, such as a WordPerfect document or a .dvi file.

E-mail messages with such files attached to them use so-called MIME, a standard for encoding binary files into normal text (which looks like garbage to a human eye). Whenever you receive a mail message marked as having MIME content (e.g. in elm it will be marked with an M next to it), you will have to decode it.

Encoding

Given a binary file named - say - `program', type
mpack -o program.enc program
This will create a file `program.enc' containing the ASCII form of the binary file. You can now send it by regular e-mail (but see below for a simpler method).

Note: there is no point at all in uuencoding plain text files such as PostScript or TeX!

Sending encoded files by mail

Let's first repeat that you should encode files to be sent only when it's necessary - doing this with plain text files is wasteful and annoying to the recipient, who might not have a very easy way to decode them.

Probably the fastest (and recommended) way to send a binary file to someone is to use our friend mpack in mail mode. To send a file `paper.dvi' to someone just type

  mpack -s "Here is my paper" paper.dvi someuser@some.place.edu
(we used the optional -s flag to specify the subject of the letter). Obviously you should only send such e-mail to those who are likely to know how to handle MIME messages.

Receiving encoded files

If you use a "smart" mail program like pine or elm, and if the letter was sent according to MIME standards, then the mail application should handle the decoding end of things. You will probably be asked what to do with the file - e.g. whether to save it to disk for later use.

If nothing like this has happened (e.g. if you use ordinary Unix mail, which knows nothing about MIME or if elm doesn't know what to do with the particular type of file you received), you should first save the message to a file, and then decode it manually. For example, if the letter was saved in a file called `from-bob', then at the Unix shell prompt simply type

  munpack from-bob
Do not remove mail headers from the file before running it through munpack. The program needs some of them to do the work, and is smart enough to skip all others.

The decoder is also very careful about not overwriting existing files. If the resulting file was supposed to be called `program' but you already have a file by that name, munpack will use the name `program.1' or some such.

PC documents

Suppose you receive a DOS WordPerfect document, or a Macintosh MS Word file as an attachment. After the mailer does its work decoding it (or if you do it manually as described above), you will end up with a file which cannot be used on our workstations, because we don't have Unix versions of the required programs. You will now have to use FTP to transfer the file from your Unix account to your PC.

Start an FTP session to the office workstation (either by clicking on the FTP icon in DesqView-X, or by typing `ftp' in a DOS window. Log in using the usual username and password. Tell FTP to use binary transfer mode by typing bin at the ftp> prompt. Suppose the document is in your home directory and has the name `advising.doc' - type get advising.doc. Close the FTP session by typing quit. A copy of the document should now be on your PC, in a directory where FTP likes to do its work (typically in C:\DVX).

Obviously, the process can be reversed. If you want to send someone an Excel document, first upload it to your Unix account, and then use mpack to mail it, as described above.


Last modified: 6/6/97 by webmaster@math.niu.edu