Internet Files

A Internet file can be a standard archive or a special format designed for transferring information over the Internet. Such files are often sent in the form of an email attachment or are received while viewing the content of a Web page.

  Encoding and Decoding

Files sent over the Internet, such as a attachment to an email message, often need to be encoded. Fortunately, most Internet applications automatically provide such encoding at the sending end and matching decoding at the receiver, often by using appropriate file helper applications.

For the purposes of this document an encoded file is known as an Internet file. Such files are generated on various computer platforms. For example, if you have a Mac OS machine you’re bound to receive numerous files that have been created on Windows computers.

File Identification

Most Internet files have a filename extension, as in myfile.uu where the extension indicates a UU encoded document. In the Classic Mac OS, the Internet control panel determines the Mac OS type code and creator code given to each file on arrival. If set up correctly, each file is assigned a correct code and is then processed, as necessary, by an appropriate file helper application. On other platforms, filename extensions are used directly, relating each document to a suitable file helper.

Classic Mac OS Content

Many of the files used in the Classic Mac OS are actually made up of three parts: a data fork, corresponding to a normal file on a non-Mac computer, a resource fork and Finder information.

When a file is manually transferred from a Mac to a non-Mac computer, only the data fork is carried across. However, the resource fork and Finder information can also be included in an Internet transfer if the file is first encoded using a format such as MacBinary, AppleSingle, AppleDouble or AppleLink Package. Fortunately, the necessary encoding or decoding is often automatically provided by your Internet applications in conjunction with appropriate file helpers.

Text Files and Binary Files

Two kind of files are used for conveying information over the Internet. A 7-bit file, also known as a text file, contains numbers in the range of 0 to 127, while an 8-bit file, also known as a binary file, contains any value from 0 to 255. Text files are often used to convey either plain text or encoded binary files. Binary files themselves, however, are frequently used for all kinds of data, including graphics files and documents containing executable code.

Common Internet files are listed in the following sections, complete with filename extensions, as used on most computer platforms, and type codes, as used in the Classic Mac OS.

  Text Files

A text file is used where a binary file can’t be used, as, for example, when sending an attachment along with an email message. Text files only contain 7-bit values from 0 to 127. Often these represent the standard ASCII characters that appear on a normal QWERTY keyboard, including letters, numbers and punctuation, as well as HT (tab), CR (carriage return), LF (line feed) and FF (form feed).

Text files are mainly used to convey plain text. However the contents of a binary file can also be encoded to create a text file, allowing the data be conveyed over systems that can’t accommodate binary files. These encoded formats can often be expanded using one of Aladdin’s StuffIt products.

The following formats, each shown with the appropriate filename extension and Classic Mac OS type code, are used for conveying 7-bit data over the Internet:-

AppleDouble  .???  TEXT

Contains one or more Classic Mac OS files, but unlike other text files, this format includes Finder information and resource forks, which means that extra encoding isn’t necessary. An AppleDouble file is sometimes more acceptable to a Windows machine than BinHex 4 encoding (see below)

AppleLink Package  .pkg  TEXT

Contains any number of Classic Mac OS files, complete with Finder information and resource forks.

BinHex 4  .hqx  TEXT

Contains data from a single binary file which has been binhexed. The contents can be unbinhexed with a suitable application. This file format shouldn’t be confused with MacBinary or BinHex 5.

Binary to ASCII (btoa)  .ascii  TEXT

Contains data from a single binary file. This format was originally created on Unix machines using the btoa application and then converted back using the atob (ASCII to binary) program.

MIME/Base64  .mime/.mim  TEXT

Contains data from a single binary file, more formally known as Multipurpose Internet Mail Enclosure (MIME) or Base64 & em dash.

UU  .uu/.uue  TEXT

Contains the data from a single binary file. This format, originally known as the Unix-to-Unix Encode process on Unix computers, is very popular with Windows users. Such a file may also be processed with Zip compression, in which case it must be decompressed prior to decoding.

When viewed using a text editor all lines will be found to begin with the letter M.

  Binary Files

These files contain 8-bit values from 0 to 255 and are usually used for non-textual data, as found in graphics documents or application files. The following archive files contain binary data:-

Type of ArchiveFilename Extensions
Arc.arc
Compact Pro.cpt
Disk Doubler.dd
Disk image.img, .image
Disk self-mounting image (SMI).smi
PackIt.pit
StuffIt.sit
Self-Extracting Archive (SEA).sea
Tape Archive (TAR).tar
TAR with BZip compression.tbz
TAR with GZip compression.tgz
Unix Compress.z, .Z, .taz
Zip.zip

The files listed below, each shown with the appropriate filename extension and Classic Mac OS type code, are also used for conveying data over the Internet:-

Aladdin Private File  .pf  CSIT

A proprietary format devised by Aladdin for encrypting text prior to sending it via email.

AppleSingle  .as  ApSi

An outdated format, conveying one Classic Mac OS file, with Finder information and resource fork.

LHa  .lha/lzh  LHA

Contains data from a single binary file, as sometimes used by FTP sites on the Internet.

  MacBinary  .bin  BINA/mBIN

Also known as BinHex 5, this format conveys a single Classic Mac OS file, complete with its Finder information, custom icon and resource fork. There are several versions, including MacBinary I, II and III, which can be decoded with various Mac applications, including Aladdin products as well as mb2mac. The Mac-related information about the file is kept in the MacBinary file’s header.

  Classic Mac OS and ICS

A file helper enables your Internet applications to handle a specific kind of file. For example, StuffIt Expander is essential as a helper for decoding Internet files. However, alternative helpers may be preferred if you want to decode less common variants of MIME and UU encoded files. For example, YA Base64 and MPack accommodate a range of MIME files whilst uucd also processes UU encoded and BinHex files. Similarly, Zip files can also be opened using the UnZip application.

In the Classic Mac OS the file helper assigned to each kind of file is determined by the Internet Configuration System (ICS), also known as Internet Config. You can change the default helpers from within the Advanced section of the Internet control panel, from the PC Exchange section of the File Exchange control panel or by using the original Internet Config application.

You can also set up file helpers from within the appropriate Preferences panel in an application such as Internet Explorer. In this instance, however, you’ll usually see the plug-ins used by the application instead of the helper applications. When you actually run Explorer it uses these plug-ins instead of the application, letting you to see or hear material within the browser itself rather than in a separate application. In other words, the settings made via the ICS (even if set up using the preferences of an Internet application) are global but can be overridden by the preferences of each application.

The plug-ins and helper applications used for a particular variety of file are usually related. For example, the QuickTime Player application is used as a helper for playing movies on the desktop whilst the QuickTime Plugin is employed to view them within Internet Explorer.

Setting up ICS

As discussed above, each kind of Internet file is identified by its filename extension, the three characters following the full-stop near the end of the file’s name. ICS marries this to the Classic Mac OS type code appropriate to the kind of file and therefore to the chosen helper application.

Although a helper may recognise several different extensions you can change the ICS settings so that a different helper is used for each variety of file. For example, ICS can be set up so that any file with the extension .xlc is automatically processed by Excel, assuming this application is on your machine. Similarly, StuffIt Expander can be assigned to process a file that carries a .sit extension, such as stuffedfile.sit whilst GraphicConveter can handle a file ending in .gif, such as picture.gif.

To see the list of current file helpers you should select File Mapping in the Advanced section of the Internet control panel. If you click on a kind of file in the list and then select Change you’ll see more information about the chosen variety of file and its associated helper. By clicking on Show Advanced Options you’ll get even more details, including the appropriate MIME Type, which consists of a Multipurpose Internet Mail Enclosure (MIME) type code and subtype.

MIME Types

The application StuffIt Expander, when used to expand files compressed with the StuffIt application, is identified by the following MIME type and subtype:-

Type:application
Subtype:x-stuffit
Full MIME code:application/x-stuffit

As you can see, the full MIME type, as shown in the Internet control panel, simply consists of the type and subtype linked together. In this example the type is application, indicating that this variety of file is related to a particular application or family of applications. Here’s another kind of file:-

Type:image
Subtype:gif
Full MIME code:image/gif

Since a GIF image file is generic it’s type is set to image. You could assign this kind of document to GraphicConverter, a useful graphics utility.

The following table shows some typical MIME codes, extensions and related helpers:-

MIME TypeDescriptionExtensionsHelper
application/pdfPortable documentpdfAdobe/Acrobat Reader
application/postscriptPostScripteps/psLaserWriter 8
application/rtfRich Text FormatrtfClarisWorks
application/x-compressUnix compressZStuffIt Expander
application/x-directorDirector moviedcr/dir/dxrShockwave
application/x-gzipGnu ZIP archivegzStuffIt Expander
application/x-shockwave-flashShockwave FlashswfQuickTime Player
application/x-tarTAR archivetarStuffIt Expander
application/x-zipZIP archivezipStuffIt Expander
audio/basicµLaw soundauQuickTime Player
audio/mp2MPEG video/audiomp2QuickTime Player
audio/x-aiffAIFF soundaiff/aif/aifcQuickTime Player
audio/vnd.rn-realaudioRealAudio clipraRealPlayer
audio/x-wavWAV soundwavQuickTime Player
image/gifGIF picturegifPicture Viewer
image/jpegJPEG picturejpeg/jpg/jpePicture Viewer
image/tiffTIFF picturetiff/tifPicture Viewer
text/htmlHyperTexthtml/htmInternet Explorer
text/plainASCII text txtSimpleText
text/tab-separated-valuesTabbed texttsvExcel
video/fliFLI animationfli/flcQuickTime Player
video/x-mpegMPEG video/audiompeg/mpg/mpeQuickTime Player
video/quicktimeQuickTime movieqt/movQuickTime Player
video/x-msvideoAVI movieaviQuickTime Player

Of the applications mentioned above, Shockwave Flash and Shockwave for Director are of particular interest. Director, originally used for creating movies, is largely used for creating Shockwave content on the Web whilst Flash has now overtaken Director in the field of interactive Web content. However, Director 8.5 can create three dimensional (3D) Web images in conjunction with Intel’s Internet 3D Graphics software, producing Shockwave 3D files with a .w3d extension.

Encryption

Some applications allow you to encrypt a file or to encrypt data whilst making an archive, although the level of security isn’t necessarily of the highest standard, particularly when compared to that provided by the Apple File Security application, as supplied with Mac OS 9 or higher.

Four common encryption algorithms are used, each offering progressively higher security. These are FastCrypt, the Data Encryption Standard (DES), Triple DES, and the International Data Encryption Algorithm (IDEA). FastCrypt can process large files in a few seconds while IDEA can take several minutes to work through a document of several megabytes.

DES, as determined by the RSA, is available in 40-bit, 56-bit and 128-bit versions. Until recently, the 56-bit and 128-bit systems were restricted to North America but they are now available worldwide, subject to individual licensing agreements. Fortunately, even the international 40-bit system provides a reasonable degree of protection with its 1,099,511,628,000 combinations. When used on the Internet, DES is usually implemented as Secure Sockets Layer (SSL) encryption.

Simpler systems of encryption are also available although most of these are usually a waste of time. The most common system is Rotate 13 (ROT13), in which each letter is replaced by one that’s 13 characters along the alphabet. This is a self-inverse system: in other word the decoding process is exactly the same as the coding method.

©Ray White 2004.