98 lines
4.4 KiB
HTML
98 lines
4.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<!-- saved from url=(0069)http://www.ece.northwestern.edu/CSEL/FAQ/e-mailing_a_binary_file.html -->
|
|
<HTML><HEAD><TITLE>E-MAILING A BINARY FILE</TITLE>
|
|
<META content="text/html; charset=gb2312" http-equiv=Content-Type><LINK
|
|
href="mailto:webmaster@ece.nwu.edu" rev=MADE>
|
|
<META content="MSHTML 5.00.3502.5390" name=GENERATOR></HEAD>
|
|
<BODY>
|
|
<P>Audience: Intermediate ECE UNIX system users Summary: Tells how to send
|
|
binary (and other non-ASCII) files through electronic mail. From: ECE system
|
|
administration office
|
|
<HR>
|
|
|
|
<P>
|
|
<H1>E-MAILING A BINARY FILE</H1><A name=1>
|
|
<H2>Contents</H2></A>
|
|
<P>I. Overview
|
|
<P>II. General Procedure
|
|
<P>III. Example
|
|
<P>IV. For More Information <A name=2>
|
|
<H3>I. Overview</H3></A>The ECE electronic mail system expects your mail
|
|
messages to consist entirely of ASCII characters. But what if you want to
|
|
include a binary (or other non-ASCII) file in an e- mail message? This document
|
|
describes one way to do this.
|
|
<P>You use a standard UNIX utility called "uuencode" to create a special
|
|
all-ASCII representation of your binary file. The resulting text file can then
|
|
be sent through e-mail just like any text file.
|
|
<P>The recipient of the encoded file then uses another UNIX utility called
|
|
"uudecode" to put the file back into its original binary form. <A name=3>
|
|
<H3>II. General Procedure</H3></A>
|
|
<P>The SENDER of the binary file should...
|
|
<OL>
|
|
<LI>Encode the file: </LI></OL>
|
|
<P>uuencode <binfile> <binfile> > <txtfile> <RET>
|
|
<P>2. E-mail the encoded file:
|
|
<P>Include <txtfile> in e-mail message as an ordinary text file.
|
|
<P>The RECIPIENT of the e-mail message should...
|
|
<OL>
|
|
<LI>Save the e-mail message to a file.
|
|
<LI>Decode the file: </LI></OL>
|
|
<P>uudecode <encodedfile> <RET> <A name=4>
|
|
<H3>III. Example</H3></A>Let's say you have a binary file called "a.out" that
|
|
you want send to your friend Liza.
|
|
<P>
|
|
<OL>
|
|
<LI>You encode the file: </LI></OL>You enter the following command to create an
|
|
all-ASCII representation of the file "a.out" called "a.txt".
|
|
<P>uuencode a.out a.out > a.txt <RET>
|
|
<P>(Note that you need to specify the filename "a.out" twice.)
|
|
<P>2. You add a personal note:
|
|
<P>You open up the file "a.txt" in your usual text editor, and add a note to
|
|
Liza at the top.
|
|
<P>Your completed message looks like this --
|
|
<P>Dear Liza,
|
|
<P>Here's my program "a.out". Decode it with "uudecode". Let me know what you
|
|
think!
|
|
<P>--Gern <PRE> begin 755 a.out
|
|
M*B "E *@!)0"0 H7 0U"+A8 , C" &'H@) 0* 0!
|
|
M ! @, 0 $ (N<(Z @0 ("P$ ! @, 0 )WC
|
|
M"!$ B0$B'L0 2Y(0( "L$ (D@.@7$ $N4$" @@*(@
|
|
...
|
|
M "6$N 2F! %D "N:$ 4+P "*X5XE01 (D!(A^T
|
|
M",(#H&B D ! H "R BN%>(HD 3 $I(0 !&4$" '%R
|
|
end
|
|
</PRE>
|
|
<P>3. You mail the message:
|
|
<P>Now you mail the file "a.txt" to Liza, whose e-mail address you know to be
|
|
"liza@merle.acns.nwu.edu".
|
|
<P>(If you use the mail program Elm, you can type "elm liza@merle.acns.nwu.edu
|
|
< a.txt <RET>" at the UNIX prompt.)
|
|
<P>The next time Liza reads her mail, she sees your message. In order to restore
|
|
the encoded file you sent her to its original format, she does the following two
|
|
things:
|
|
<OL>
|
|
<LI>Liza saves your message to a file: </LI></OL>
|
|
<P>From within her mail program, Liza saves your message in her current
|
|
directory under the name "gern". (Different mail programs have different ways
|
|
for doing this. From the main screen of Elm, for example, she would select your
|
|
message and type "s gern <RET>".)
|
|
<P>2. Liza decodes the file:
|
|
<P>She quits her mail program, and types the following command at the UNIX
|
|
prompt:
|
|
<P>uudecode gern <RET>
|
|
<P>And that's it! Liza now has an exact copy of your ori- ginal binary file
|
|
"a.out" in her current directory! <A name=5>
|
|
<H3>IV. For More Information</H3></A>
|
|
<UL>
|
|
<LI>See the man page for "uuencode".
|
|
<LI>Send a detailed message to the ECE system administrator at the e-mail
|
|
address "root@ece.nwu.edu".
|
|
<LI>Drop by the ECE system administration office in Tech M334. </LI></UL>
|
|
<P>
|
|
<HR>
|
|
|
|
<ADDRESS><A href="mailto:webmaster@ece.nwu.edu"><IMG alt=""
|
|
src="E-MAILING A BINARY FILE.files/webmaster.gif">
|
|
webmaster@ece.nwu.edu</A>.<BR>Last Updated: $Date: 2000/02/22 15:47:08 $
|
|
</ADDRESS></BODY></HTML>
|