The MIME type array is a sub-class of the built-in Array class. It is called a MimeTypeArray.
Here is a list of MIME types supported in recent versions of MSIE and Netscape :
Type | Description |
---|---|
application/mac-binhex40 | Macintosh BinHex Archive |
application/macbinary | MacBinary application |
application/msword | Microsoft Word Document |
application/pdf | Adobe Portable Document Format (PDF) |
application/postscript | PostScript File |
application/rtf | Rich Text Format File |
application/sdp | Session Description Protocol |
application/smil | SMIL Document |
application/streamingmedia | Standard Streaming Metafile |
application/vnd.ms-excel | Microsoft Excel Worksheet |
application/vnd.ms-powerpoint | Microsoft PowerPoint Presentation |
application/vnd.rn-realmedia | RealMedia File |
application/vnd.rn-realplayer | RealPlayer File |
application/vnd.rn-realsystem-rjs | RealSystem Skin |
application/vnd.rn-realsystem-rmx | RealSystem Secure Media Clip |
application/vnd.rn-rn_music_package | RealJukebox Music Package |
application/vnd.rn-rsml | RealSystem ML File |
application/wordperfect5.1 | WordPerfect PC 5.1 Doc |
application/x-compress | Unix Compressed (.z) Files |
application/x-director | Shockwave |
application/x-dvi | TeX DVI Document |
application/x-javascript | JavaScript Program |
application/x-macbinary | MacBinary File |
application/x-rtsp | Real Time Streaming Protocol |
application/x-sdp | Scalable Multicast |
application/x-stuffit | Macintosh StuffIt Archive |
application/x-tar | Unix TAR Archive |
application/zip | ZIP Archives |
audio/basic | ULAW/AU Audio |
audio/mid | MIDI |
audio/mp3 | MP3 Audio |
audio/mpeg | MPEG audio stream |
audio/mpegurl | MP3 PlayLists (.m3u,.pls) |
audio/mpg | MP3 Audio |
audio/scpls | MP3 PlayLists (.m3u,.pls) |
audio/vnd.qcelp | QCP Audio |
audio/vnd.rn-realaudio | RealAudio Clip |
audio/x-aiff | AIFF Audio |
audio/x-mp3 | MP3 Audio |
audio/x-mpeg | MPEG audio stream |
audio/x-mpegurl | MP3 PlayLists (.m3u,.pls) |
audio/x-mpg | MP3 Audio |
audio/x-pn-realaudio | RealPlayer File |
audio/x-scpls | MP3 PlayLists (.m3u,.pls) |
audio/x-wav | WAV Audio |
image/gif | GIF Image |
image/ief | IEF image |
image/jpeg | JPEG Image |
image/pict | PICT Image |
image/png | PNG Image |
image/tiff | TIFF Image |
image/vnd.rn-realflash | RealFlash Clip |
image/vnd.rn-realpix | RealPix Clip |
image/x-pict | PICT Image |
image/x-portable-bitmap | Portable Bitmap (PBM) |
image/x-portable-graymap | Portable Graymap (PGM) |
image/x-portable-pixmap | Portable Pixmap (PPM) |
image/x-quicktime | QuickTime Image |
image/x-rgb | SGI RGB Image |
image/x-xbitmap | X Bitmap Image |
image/x-xpixmap | X-Windows Pixmap |
text/html | HTML Document |
text/plain | Text File |
text/vnd.rn-realtext | RealText Clip |
video/mpeg | MPEG video/audio stream |
video/msvideo | Microsoft Video |
video/quicktime | QuickTime Movie |
video/vnd.rn-realvideo | RealVideo Clip |
video/x-msvideo | Microsoft Video |
Some MIME types are only supported by Netscape:
Type | Description |
application/fractals | Fractal Image Format |
application/futuresplash | FutureSplash Player |
application/gzip | application/gzip |
application/java-archive | Java Archive |
application/ms-powerpoint | application/ms-powerpoint |
application/octet-stream | Binary Executable |
application/pre-encrypted | Pre-encrypted Data |
application/vnd.lotus-1-2-3 | Lotus 123 Document |
application/vnd.lotus-approach | Lotus Approach Document |
application/vnd.lotus-freelance | Lotus Freelance Document |
application/vnd.lotus-organizer | Lotus Organizer Document |
application/vnd.lotus-screencam | Lotus ScreenCam Movie |
application/vnd.lotus-wordpro | Lotus WordPro Document |
application/vnd.ms-access | Microsoft Access Database |
application/vnd.ms-schedule | Microsoft Schedule+ Application |
application/x-authorware-map | Authorware |
application/x-compressed | application/x-compressed |
application/x-conference | application/x-conference |
application/x-cpio | Unix CPIO Archive |
application/x-csh | C Shell Program |
application/x-excel | application/x-excel |
application/x-fortezza-ckl | Compromised Key List |
application/x-gtar | GNU Tape Archive |
application/x-javascript-config | JavaScript Config |
application/x-latex | LaTeX Document |
application/x-ns-proxy-autoconfig | Proxy Auto-Config |
application/x-perl | Perl Program |
application/x-pkcs7-crl | Certificate Revocation List |
application/x-pkcs7-mime | PKCS7 Encrypted Data |
application/x-pkcs7-signature | PKCS7 Signature |
application/x-sh | Bourne Shell Program |
application/x-shar | Unix Shell Archive |
application/x-shockwave-flash | Shockwave Flash |
application/x-tcl | TCL Program |
application/x-tex | TeX Document |
application/x-texinfo | GNU TeXinfo Document |
application/x-zip-compressed | Zip Compressed Data |
audio/rmf | audio/rmf |
audio/x-rmf | audio/x-rmf |
image/x-cmu-raster | CMU Raster Image |
image/x-MS-bmp | Windows Bitmap |
image/x-photo-cd | PhotoCD Image |
image/x-portable-anymap | PBM Image |
image/x-xwindowdump | X Window Dump Image |
Netscape/Source | Special file type |
Netscape/Telnet | Netscape/Telnet |
Netscape/tn3270 | Netscape/tn3270 |
text/x-vcard | VCard |
video/x-mpeg2 | MPEG2 Video |
video/x-qtc | video/x-qtc |
These MIME types are supported only by MSIE:
Type | Description |
application/applefile | AppleSingle file |
application/AppleLink | AppleLink Package |
application/ArcMac | PC ARChive |
application/BBEdit | ML Source |
application/binary | Application Binary Data |
application/Canvas | Canvas Drawing |
application/cdf | Channels |
application/CodeWarrior | Java Class File |
application/Compact_Pro | Compact Pro Archive |
application/DeArj | ARJ Archive |
application/DiskCopy | Apple DiskCopy Image |
application/Envoy | Envoy Document |
application/Excel | Lotus Spreadsheet r2.1 |
application/FileMaker_Pro | FileMaker Pro Database |
application/FileMaker_Pro_3 | FileMaker Pro Database |
application/Finder | OpenType Font |
application/FoxBase+ | DBase Document |
application/GraphicConverter | Animated NeoChrome |
application/HexEdit | Untyped Binary Data |
application/JPEGView | OS/2 Bitmap |
application/MacAmp | MPEG-1 Layer 3 |
application/MacAnim_Viewer | DL Animation |
application/MacBooz | Zoo Archive |
application/MacLHA | LHArc Archive |
application/macwriteii | MacWrite Document |
application/Microsoft_Word | Word for Windows Template |
application/MoviePlayer | DV Video |
application/netcdf | Channels |
application/oda | ODA Document |
application/PageMaker | PageMaker 3 Document |
application/PF_Encrypt | Private File |
application/pgp-keys | PGP Key File |
application/Photoshop | PhotoShop Document |
application/PictureViewer | OS/2 Bitmap |
application/PlayerPro | 669 MOD Music |
application/QuarkXpress | QuarkXpress Document |
application/Replica | Replica Document |
application/ResEdit | Resource File |
application/self-extracting | Self-Extracting Archive |
application/Self_Extracting_Archive | Self-Extracting Archive |
application/SimpleText | Apple documentation file |
application/SoftWindows | MS-DOS Executable |
application/SoundApp | Amiga OctaMed music |
application/SoundHack | IRCAM Sound |
application/StuffIt | StuffIt Archive |
application/StuffIt_Expander | PackIt Archive |
application/SunTar | Unix BAR Archive |
application/vnd.fdf | Forms Data Format |
application/waf | Website Archive |
application/WordPerfect | WordPerfect PC 4.2 Doc |
application/x-cdf | Channels |
application/x-gocserve | CompuServe Inbound Link to CIM 3.0 |
application/x-gzip | GZIP File |
application/x-hdf | HDF Data File |
application/x-netcdf | Channels |
application/x-sgml | SGML Document |
application/x-x509-ca-cert | Certificates |
application/xml | HTML Document |
audio/aiff | AIFF Audio |
audio/midi | MIDI |
audio/wav | WAV Audio |
audio/x-midi | MIDI |
audio/x-pn-realaudio-plugin | RealPlayer Plugin |
image/x-bmp | Windows BMP Image |
image/x-fits | Flexible Image Transport |
image/x-macpaint | MacPaint Image |
image/x-macpict | PICT Picture |
image/x-pbm | Portable Bitmap |
image/x-pgm | Portable Graymap |
image/x-photoshop | Photoshop Image |
image/x-png | PNG Image |
image/x-ppm | Portable Pixmap |
image/x-sgi | SGI Image |
image/x-targa | Targa Truevision Image |
image/x-tiff | TIFF Image |
image/x-xbm | X-Windows Bitmap |
image/x-xpm | X-Windows Pixmap |
image/x-xwd | X-Windows Dump |
image/xbitmap | X Bitmap Image |
image/xbm | X Bitmap Image |
message/external-body | URL Bookmark |
text/cdf | Channels |
text/css | Text File |
text/javascript | Text File |
text/Jscript | Text File |
text/url | URL File |
text/vbs | Text File |
text/vbscript | Text File |
text/x-cdf | Channels |
text/xml | HTML Document |
video/avi | Microsoft Video |
video/flc | FLC Animation |
video/x-mpeg | MPEG video/audio stream |
x-world/x-3dmf | QuickDraw 3D File |
x-world/x-vrml | VRML File |
The example inspects the available MIME types. For each one, it will display these properties (note that only one is shown as an example):
type:audio/x-rmf
description:audio/x-rmf
suffixes:rmf
enabledPlugin:[object Plugin]
In MSIE version 4.5 for Macintosh, this returns the undefined value and therefore you cannot establish the mime types that the browser will support. In MSIE for other platforms a null value may be returned.
In Netscape the array element property name values are the same as the type name. In MSIE version 5, the values are simply the numeric index. This may affect the way that you access the array. However, you can access the type property of each element in the array and if you check that, you should be able to build a portable script.
MSIE and Netscape support different sets of MIME types. Some are supported on both and some only on one. They also differ somewhat in the textual description of the MIME type so it is really only safe to test the type property and ignore the description property.
If you write an inspector script to dump the array values out to the screen, you may observe that some types do not have a descriptive name and in a couple of cases, a MIME-type exists with a name but no correctly defined type value. This may be version, and platform, specific. The values reported by this array may also be modified according to what you do in the preferences panels regarding the mapping of file types to helper applications.
Many MIME types that are browser specific may actually be similar to mime types in other browsers. Because these are created and defined by different browser manufacturers there is always likely to be some browser-dependent differences.
The associative array technique may not always work across browsers.
<!-- Show all mime types installed --> <HTML> <HEAD> </HEAD> <BODY> <SCRIPT> for (var myIndex=0; myIndex<navigator.mimeTypes.length; myIndex++) { for(var myProperty in navigator.mimeTypes[myIndex]) { document.write(myProperty); document.write(":"); document.write(navigator.mimeTypes[myIndex][myProperty]); document.write("<BR>"); } document.write("<HR>"); } </SCRIPT> </BODY> </HTML>
See also: | MimeType object, MimeTypeArray object |
Prev | Home | Next |
Navigator.language | Up | Navigator.onLine |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |