/[pxelator]/lib/Media/Type/Simple.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /lib/Media/Type/Simple.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 249 - (hide annotations)
Tue Aug 18 12:18:49 2009 UTC (14 years, 8 months ago) by dpavlin
File size: 25911 byte(s)
and depdendency for it
1 dpavlin 249 package Media::Type::Simple;
2    
3     use strict;
4     use warnings;
5    
6     use Carp;
7     use Storable qw( freeze thaw );
8    
9     # TODO - option to disable reading of MIME types with no associated extensions
10    
11     {
12     # no strict 'refs';
13    
14     use Sub::Exporter -setup => {
15     exports => [qw( is_type alt_types ext_from_type ext3_from_type
16     is_ext type_from_ext add_type )],
17     groups => {
18     default => [qw( is_type alt_types ext_from_type ext3_from_type is_ext type_from_ext) ],
19     }
20     }
21     }
22    
23     =head1 NAME
24    
25     Media::Type::Simple - MIME Media Types and their file extensions
26    
27     =begin readme
28    
29     =head1 REQUIREMENTS
30    
31     The following non-core modules are required:
32    
33     Sub::Exporter
34    
35     =head1 INSTALLATION
36    
37     Installation can be done using the traditional Makefile.PL or the newer
38     Build.PL methods.
39    
40     Using Makefile.PL:
41    
42     perl Makefile.PL
43     make test
44     make install
45    
46     (On Windows platforms you should use C<nmake> instead.)
47    
48     Using Build.PL (if you have Module::Build installed):
49    
50     perl Build.PL
51     perl Build test
52     perl Build install
53    
54     =end readme
55    
56     =head1 VERSION
57    
58     Version 0.02
59    
60     =cut
61    
62     our $VERSION = '0.02';
63    
64     =head1 SYNOPSIS
65    
66     use Media::Type::Simple;
67    
68     $type = type_from_ext("jpg"); # returns "image/jpeg"
69    
70     $ext = ext_from_type("text/plain"); # returns "txt"
71    
72    
73     =head1 DESCRIPTION
74    
75     This package gives a simple functions for obtaining common file
76     extensions from media types, and from obtaining media types from
77     file extensions.
78    
79     It is also relaxed with respect to having multiple media types
80     associated with a file extension, or multiple extensions associated
81     with a media type, and it includes media types for encodings such
82     as F<gzip>. It is defined this way in the default data, but
83     this does not meet your needs, then you can have it use a system file
84     (e.g. F</etc/mime.types>) or custom data.
85    
86     By default, there is a functional interface, although you can also use
87     an object-oriented inteface. (Different objects will not share the same
88     data.)
89    
90     =for readme stop
91    
92     =head2 Methods
93    
94     =cut
95    
96     my $Default; # Pristine copy of __DATA__
97     my $Work; # Working copy of __DATA__
98    
99    
100     =over
101    
102     =item new
103    
104     $o = Media::Type::Simple->new;
105    
106     Creates a new object. You may optionally give it a filehandle of a file
107     with system Media information, e.g.
108    
109     open $f, "/etc/mime.types";
110     $o = Media::Type::Simple->new( $f );
111    
112     =begin internal
113    
114     When L</new> is called for the first time without a file handle, it
115     checks to see if the C<$Default> instance is initialised: if it is
116     not, then it initialises it and returns a L</clone> of C<$Default>.
117    
118     We operate on clones rather than the original, so that any changes
119     made, e.g. L</add_type>, will not affect all other instances.
120    
121     =end internal
122    
123     =cut
124    
125     sub new {
126     my $class = shift;
127     my $self = { types => { }, extens => { }, };
128    
129     bless $self, $class;
130    
131     if (@_) {
132     my $fh = shift;
133     return $self->add_types_from_file( $fh );
134     }
135     else {
136     unless (defined $Default) {
137     $Default = $self->add_types_from_file( \*DATA );
138     }
139     return clone $Default;
140     }
141     }
142    
143     =begin internal
144    
145     =item _args
146    
147     An internal function used to process arguments, based on C<_args> from
148     the L<self> package. It also allows one to use it in non-object
149     oriented mode.
150    
151     When L</_args> is called for the first time without a reference to the
152     class instance, it checks to see if C<$Work> is defined, and it is
153     initialised with L</new> if it is not defined. This means that
154     C<$Work> is only initialised when the module is used.
155    
156     =item self
157    
158     An internal function used in place of the C<$self> variable.
159    
160     =item args
161    
162     An internal function used in place of shifting arguments from stack.
163    
164     =end internal
165    
166     =cut
167    
168     # _args, self and args based on 'self' v0.15
169    
170     sub _args {
171     my $level = 2;
172     my @c = ();
173     while ( !defined($c[3]) || $c[3] eq '(eval)') {
174     @c = do {
175     package DB; # Module::Build hates this!
176     @DB::args = ();
177     caller($level);
178     };
179     $level++;
180     }
181    
182     my @args = @DB::args;
183    
184     if (ref($args[0]) ne __PACKAGE__) {
185     unless (defined $Work) {
186     $Work = __PACKAGE__->new();
187     }
188     unshift @args, $Work;
189     }
190    
191     return @args;
192     }
193    
194     sub self {
195     (_args)[0];
196     }
197    
198     sub args {
199     my @a = _args;
200     return @a[1..$#a];
201     }
202    
203    
204     =item add_types_from_file
205    
206     $o->add_types_from_file( $filehandle );
207    
208     Imports types from a file. Called by L</new> when a filehandle is
209     specified.
210    
211     =cut
212    
213     sub add_types_from_file {
214     my ($fh) = args;
215    
216     while (my $line = <$fh>) {
217     $line =~ s/^\s+//;
218     $line =~ s/\#.*$//;
219     $line =~ s/\s+$//;
220    
221     if ($line) {
222     self->add_type(split /\s+/, $line);
223     }
224     }
225     return self;
226     }
227    
228     =item is_type
229    
230     if (is_type("text/plain")) { ... }
231    
232     if ($o->is_type("text/plain")) { ... }
233    
234     Returns a true value if the type is defined in the system.
235    
236     Note that a true value does not necessarily indicate that the type
237     has file extensions associated with it.
238    
239     =begin internal
240    
241     Currently it returns a reference to a list of extensions associated
242     with that type. This is for convenience, and may change in future
243     releases.
244    
245     =end internal
246    
247     =cut
248    
249     sub is_type {
250     my ($type) = args;
251     my ($cat, $spec) = split_type($type);
252     return self->{types}->{$cat}->{$spec};
253     }
254    
255     =item alt_types
256    
257     @alts = alt_types("image/jpeg");
258    
259     @alts = $o->alt_types("image/jpeg");
260    
261     Returns alternative or related Media types that are defined in the system
262     For instance,
263    
264     alt_types("model/dwg")
265    
266     returns the list
267    
268     image/vnd.dwg
269    
270     =begin internal
271    
272     =item _normalise
273    
274     =item _add_aliases
275    
276     =end internal
277    
278     =cut
279    
280     {
281    
282     # Some known special cases (keys are normalised). Not exhaustive.
283    
284     my %SPEC_CASES = (
285     "application/cdf" => [qw( application/netcdf )],
286     "application/dms" => [qw( application/octet-stream )],
287     "application/x-java-source" => [qw( text/plain )],
288     "application/java-vm" => [qw( application/octet-stream )],
289     "application/lha" => [qw( application/octet-stream )],
290     "application/lzh" => [qw( application/octet-stream )],
291     "application/mac-binhex40" => [qw( application/binhex40 )],
292     "application/msdos-program" => [qw( application/octet-stream )],
293     "application/ms-pki.seccat" => [qw( application/vnd.ms-pkiseccat )],
294     "application/ms-pki.stl" => [qw( application/vnd.ms-pki.stl )],
295     "application/ndtcdf" => [qw( application/cdf )],
296     "application/netfpx" => [qw( image/vnd.fpx image/vnd.net-fpx )],
297     "image/fpx" => [qw( application/vnd.netfpx image/vnd.net-fpx )],
298     "image/netfpx" => [qw( application/vnd.netfpx image/vnd.fpx )],
299     "text/c++hdr" => [qw( text/plain )],
300     "text/c++src" => [qw( text/plain )],
301     "text/chdr" => [qw( text/plain )],
302     "text/fortran" => [qw( text/plain )],
303     );
304    
305    
306     sub _normalise {
307     my $type = shift;
308     my ($cat, $spec) = split_type($type);
309    
310     # We "normalise" the type
311    
312     $cat =~ s/^x-//;
313     $spec =~ s/^(x-|vnd\.)//;
314    
315     return ($cat, $spec);
316     }
317    
318     sub _add_aliases {
319     my @aliases = @_;
320     foreach my $type (@aliases) {
321     my ($cat, $spec) = _normalise($type);
322     $SPEC_CASES{"$cat/$spec"} = \@aliases;
323     }
324     }
325    
326     _add_aliases(qw( application/mp4 video/mp4 ));
327     _add_aliases(qw( application/json text/json ));
328     _add_aliases(qw( application/cals-1840 image/cals-1840 image/cals image/x-cals application/cals ));
329     _add_aliases(qw( application/mac-binhex40 application/binhex40 ));
330     _add_aliases(qw( application/atom+xml application/atom ));
331     _add_aliases(qw( application/fractals image/fif ));
332     _add_aliases(qw( model/vnd.dwg image/vnd.dwg image/x-dwg application/acad ));
333     _add_aliases(qw( image/vnd.dxf image/x-dxf application/x-dxf application/vnd.dxf ));
334     _add_aliases(qw( text/x-c text/csrc ));
335     _add_aliases(qw( application/x-helpfile application/x-winhlp ));
336     _add_aliases(qw( application/x-tex text/x-tex ));
337     _add_aliases(qw( application/rtf text/rtf ));
338     _add_aliases(qw( image/jpeg image/pipeg image/pjpeg ));
339     _add_aliases(qw( text/javascript text/javascript1.0 text/javascript1.1 text/javascript1.2 text/javascript1.3 text/javascript1.4 text/javascript1.5 text/jscript text/livescript text/x-javascript text/x-ecmascript aplication/ecmascript application/javascript ));
340    
341    
342     sub alt_types {
343     my ($type) = args;
344     my ($cat, $spec) = _normalise($type);
345    
346     my %alts = ( );
347     my @cases = ( "$cat/$spec", "$cat/x-$spec", "x-$cat/x-$spec",
348     "$cat/vnd.$spec" );
349    
350     push @cases, @{ $SPEC_CASES{"$cat/$spec"} },
351     if ($SPEC_CASES{"$cat/$spec"});
352    
353     foreach ( @cases ) {
354     $alts{$_} = 1, if (self->is_type($_));
355     }
356    
357     return (sort keys %alts);
358     }
359     }
360    
361     =item ext_from_type
362    
363     $ext = ext_from_type( $type );
364    
365     @exts = ext_from_type( $type );
366    
367     $ext = $o->ext_from_type( $type );
368    
369     @exts = $o->ext_from_type( $type );
370    
371     Returns the file extension(s) associated with the given Media type.
372     When called in a scalar context, returns the first extension from the
373     list.
374    
375     The order of extensions is based on the order that they occur in the
376     source data (either the default here, or the order added using
377     L</add_types_from_file> or calls to L</add_type>).
378    
379     =cut
380    
381     sub ext_from_type {
382     if (my $exts = self->is_type(args)) {
383     return (wantarray ? @$exts : $exts->[0]);
384     }
385     else {
386     return;
387     }
388     }
389    
390     =item ext3_from_type
391    
392     Like L</ext_from_type>, but only returns file extensions under three
393     characters long.
394    
395     =cut
396    
397     sub ext3_from_type {
398     my @exts = grep( (length($_) <= 3), (ext_from_type(@_)));
399     return (wantarray ? @exts : $exts[0]);
400     }
401    
402     =item is_ext
403    
404     if (is_ext("image/jpeg")) { ... }
405    
406     if ($o->is_type("image/jpeg")) { ... }
407    
408     Returns a true value if the extension is defined in the system.
409    
410     =begin internal
411    
412     Currently it returns a reference to a list of types associated
413     with that extension. This is for convenience, and may change in future
414     releases.
415    
416     =end internal
417    
418     =cut
419    
420     sub is_ext {
421     my ($ext) = args;
422     if (exists self->{extens}->{$ext}) {
423     return self->{extens}->{$ext};
424     }
425     else {
426     return;
427     }
428     }
429    
430     =item type_from_ext
431    
432     $type = type_from_ext( $extension );
433    
434     @types = type_from_ext( $extension );
435    
436     $type = $o->type_from_ext( $extension );
437    
438     @types = $o->type_from_ext( $extension );
439    
440     Returns the Media type(s) associated with the extension. When called
441     in a scalar context, returns the first type from the list.
442    
443     The order of types is based on the order that they occur in the
444     source data (either the default here, or the order added using
445     L</add_types_from_file> or calls to L</add_type>).
446    
447     =cut
448    
449     sub type_from_ext {
450     my ($ext) = args;
451    
452     if (my $ts = self->is_ext($ext)) {
453     my @types = map { $_ } @$ts;
454     return (wantarray ? @types : $types[0]);
455     }
456     else {
457     croak "Unknown extension: $ext";
458     }
459     }
460    
461     =begin internal
462    
463     =item split_type
464    
465     ($content_type, $subtype) = split_type( $type );
466    
467     This is a utlity function for splitting content types.
468    
469     =end internal
470    
471     =cut
472    
473     sub split_type {
474     my $type = shift;
475     my ($cat, $spec) = split /\//, $type;
476     return ($cat, $spec);
477     }
478    
479     =item add_type
480    
481     $o->add_type( $type, @extensions );
482    
483     Add a type to the system, with an optional list of extensions.
484    
485     =cut
486    
487     sub add_type {
488     my ($type, @exts) = args;
489    
490     if (@exts || 1) { # TODO - option to ignore types with no extensions
491    
492     my ($cat, $spec) = split_type($type);
493    
494     if (!self->{types}->{$cat}->{$spec}) {
495     self->{types}->{$cat}->{$spec} = [ ];
496     }
497     push @{ self->{types}->{$cat}->{$spec} }, @exts;
498    
499    
500     foreach (@exts) {
501     self->{extens}->{$_} = [] unless (exists self->{extens}->{$_});
502     push @{self->{extens}->{$_}}, $type
503     }
504     }
505     }
506    
507     =item clone
508    
509     $c = $o->clone;
510    
511     Returns a clone of a Media::Type::Simple object. This allows you to add
512     new types via L</add_types_from_file> or L</add_type> without affecting
513     the original.
514    
515     This can I<only> be used in the object-oriented interface.
516    
517     =cut
518    
519     sub clone {
520     my $self = shift;
521     croak "Expected instance" if (ref($self) ne __PACKAGE__);
522     return thaw( freeze $self );
523     }
524    
525    
526     =back
527    
528     =for readme continue
529    
530     =head1 REVISION HISTORY
531    
532     For a detailed history see the F<Changes> file included in this distribution.
533    
534     =head1 SEE ALSO
535    
536     The L<MIME::Types> module has a similar functionality, but with a more
537     complex interface.
538    
539     An "official" list of Media Types can be found at
540     L<http://www.iana.org/assignments/media-types>.
541    
542     =head1 AUTHOR
543    
544     Robert Rothenberg <rrwo at cpan.org>
545    
546     =head2 Suggestions and Bug Reporting
547    
548     Feedback is always welcome. Please use the CPAN Request Tracker at
549     L<http://rt.cpan.org> to submit bug reports.
550    
551     =head1 ACKNOWLEDGEMENTS
552    
553     Some of the code comes from L<self> module (by Kang-min Liu). The data
554     for the media types is based on the Debian mime-support package,
555     L<http://packages.debian.org/mime-support>,
556     although with I<many> changes from the original.
557    
558     =head1 COPYRIGHT & LICENSE
559    
560     Copyright 2009 Robert Rothenberg, all rights reserved.
561    
562     This program is free software; you can redistribute it and/or modify it
563     under the same terms as Perl itself.
564    
565     =cut
566    
567     1;
568    
569    
570     __DATA__
571     application/andrew-inset ez
572     application/atom+xml atom
573     application/atomcat+xml atomcat
574     application/atomserv+xml atomsrv
575     application/cals-1840 cal
576     application/cap cap pcap
577     application/cu-seeme cu
578     application/dsptype tsp
579     application/envoy evy
580     application/fractals fif
581     application/futuresplash spl
582     application/hta hta
583     application/internet-property-stream acx
584     application/javascript js
585     application/java-archive jar
586     application/java-serialized-object ser
587     application/java-vm class
588     application/mac-binhex40 hqx
589     application/mac-compactpro cpt
590     application/mathematica nb
591     application/mp4 mpeg4 mp4
592     application/msaccess mdb
593     application/msword doc dot
594     application/mxf mxf
595     application/octet-stream bin
596     application/oda oda
597     application/ogg ogg ogx
598     application/pdf pdf
599     application/x-perfmon pma pmc pml pmr pmw
600     application/pgp-encrypted pgp asc
601     application/pgp-keys key
602     application/pgp-signature pgp asc
603     application/pics-rules prf
604     application/pkcs10 p10
605     application/x-pkcs12 p12 pfx
606     application/x-pkcs7-certificates p7b spc
607     application/x-pkcs7-certreqresp p7r
608     application/pkcs7-mime p7c p7m
609     application/pkcs7-signature p7s
610     application/pkix-crl crl
611     application/postscript ps ai eps
612     application/rar rar
613     application/rdf+xml rdf
614     application/rss+xml rss
615     application/rtf rtf
616     application/set-payment-initiation setpay
617     application/set-registration-initiation setreg
618     application/sgml sgml sml
619     application/smil smi smil
620     application/wordperfect wpd doc
621     application/wordperfect5.1 wp5
622     application/xhtml+xml xhtml xht
623     application/xml xml xsl
624     application/xml-dtd dtd
625     application/zip zip
626     application/vnd.cinderella cdy
627     application/vnd.google-earth.kml+xml kml
628     application/vnd.google-earth.kmz kmz
629     application/vnd.lotus-1-2-3 wks wk1 wk2 wk3 wk4
630     application/vnd.lotus-approach apr apx apt
631     application/vnd.lotus-freelance dgm prz
632     application/vnd.lotus-notes nsf
633     application/vnd.lotus-organizer or2 or3 or4
634     application/vnd.lotus-screencam
635     application/vnd.lotus-wordpro lwp
636     application/vnd.mozilla.xul+xml xul
637     application/vnd.ms-artgalry
638     application/vnd.ms-asf
639     application/vnd.ms-excel xls xlt xla xlb xlc xlm xlw
640     application/vnd.ms-lrm
641     application/vnd.ms-outlook msg
642     application/vnd.ms-pki.seccat cat
643     application/vnd.ms-pki.stl stl
644     application/vnd.ms-powerpoint ppt pps pot
645     application/vnd.ms-project mpp
646     application/vnd.ms-tnef
647     application/vnd.ms-works wcm wdb wks wps
648     application/winhlp hlp
649     application/vnd.netfpx fpx
650     application/vnd.oasis.opendocument.chart odc
651     application/vnd.oasis.opendocument.database odb
652     application/vnd.oasis.opendocument.formula odf
653     application/vnd.oasis.opendocument.graphics odg
654     application/vnd.oasis.opendocument.graphics-template otg
655     application/vnd.oasis.opendocument.image odi
656     application/vnd.oasis.opendocument.presentation odp
657     application/vnd.oasis.opendocument.presentation-template otp
658     application/vnd.oasis.opendocument.spreadsheet ods
659     application/vnd.oasis.opendocument.spreadsheet-template ots
660     application/vnd.oasis.opendocument.text odt
661     application/vnd.oasis.opendocument.text-master odm
662     application/vnd.oasis.opendocument.text-template ott
663     application/vnd.oasis.opendocument.text-web oth
664     application/vnd.rim.cod cod
665     application/vnd.smaf mmf
666     application/vnd.stardivision.calc sdc
667     application/vnd.stardivision.chart sds
668     application/vnd.stardivision.draw sda
669     application/vnd.stardivision.impress sdd
670     application/vnd.stardivision.math sdf
671     application/vnd.stardivision.writer sdw
672     application/vnd.stardivision.writer-global sgl
673     application/vnd.sun.xml.calc sxc
674     application/vnd.sun.xml.calc.template stc
675     application/vnd.sun.xml.draw sxd
676     application/vnd.sun.xml.draw.template std
677     application/vnd.sun.xml.impress sxi
678     application/vnd.sun.xml.impress.template sti
679     application/vnd.sun.xml.math sxm
680     application/vnd.sun.xml.writer sxw
681     application/vnd.sun.xml.writer.global sxg
682     application/vnd.sun.xml.writer.template stw
683     application/vnd.symbian.install sis
684     application/vnd.visio vsd
685     application/vnd.wap.wbxml wbxml
686     application/vnd.wap.wmlc wmlc
687     application/vnd.wap.wmlscriptc wmlsc
688     application/x-123 wk
689     application/x-7z-compressed 7z
690     application/x-abiword abw
691     application/x-apple-diskimage dmg
692     application/x-bcpio bcpio
693     application/x-bittorrent torrent
694     application/x-bzip2 bz2
695     application/x-cab cab
696     application/x-cbr cbr
697     application/x-cbz cbz
698     application/x-cdf cdf
699     application/x-cdlink vcd
700     application/x-chess-pgn pgn
701     application/x-compress z Z
702     application/x-compressed taz tgz tar.gz
703     application/x-cpio cpio
704     application/x-csh csh
705     application/x-debian-package deb udeb
706     application/x-director dcr dir dxr
707     application/x-dms dms
708     application/x-doom wad
709     application/x-dvi dvi
710     application/x-httpd-eruby rhtml
711     application/x-flac flac
712     application/x-font pfa pfb gsf pcf pcf.Z
713     application/x-freemind mm
714     application/x-futuresplash spl
715     application/x-gnumeric gnumeric
716     application/x-go-sgf sgf
717     application/x-graphing-calculator gcf
718     application/x-gtar gtar tgz taz
719     application/x-gzip gz
720     application/x-hdf hdf
721     application/x-httpd-php phtml pht php
722     application/x-httpd-php-source phps
723     application/x-httpd-php3 php3
724     application/x-httpd-php3-preprocessed php3p
725     application/x-httpd-php4 php4
726     application/x-ica ica
727     application/x-internet-signup ins isp
728     application/x-iphone iii
729     application/x-iso9660-image iso
730     application/x-java-applet class
731     application/x-java-commerce jcm
732     application/x-java-jnlp-file jnlp
733     application/x-java-source java
734     application/x-javascript js
735     application/x-jmol jmz
736     application/x-kchart chrt
737     application/x-killustrator kil
738     application/x-koan skp skd skt skm
739     application/x-kpresenter kpr kpt
740     application/x-kspread ksp
741     application/x-kword kwd kwt
742     application/x-latex latex
743     application/x-lha lha
744     application/x-lyx lyx
745     application/x-lzh lzh
746     application/x-lzx lzx
747     application/x-maker frm maker frame fm fb book fbdoc
748     application/x-mif mif
749     application/x-ms-wmd wmd
750     application/x-ms-wmz wmz
751     application/x-msdos-program com exe bat dll
752     application/x-msi msi
753     application/x-netcdf nc cdf
754     application/x-ns-proxy-autoconfig pac
755     application/x-nwc nwc
756     application/x-object o
757     application/x-oz-application oza
758     application/x-pkcs7-certreqresp p7r
759     application/x-pkcs7-crl crl
760     application/x-python-code pyc pyo
761     application/x-quicktimeplayer qtl
762     application/x-redhat-package-manager rpm
763     application/x-sh sh
764     application/x-shar shar
765     application/x-shockwave-flash swf swfl
766     application/x-stuffit sit sitx
767     application/x-sv4cpio sv4cpio
768     application/x-sv4crc sv4crc
769     application/x-tar tar
770     application/x-tcl tcl
771     application/x-tex-gf gf
772     application/x-tex-pk pk
773     application/x-texinfo texinfo texi
774     application/x-trash backup bak old sik ~ %
775     application/x-troff t tr roff
776     application/x-troff-man man
777     application/x-troff-me me
778     application/x-troff-ms ms
779     application/x-ustar ustar
780     application/x-wais-source src
781     application/x-wingz wz
782     application/x-x509-ca-cert crt
783     application/x-xcf xcf
784     application/x-xfig fig
785     application/x-xpinstall xpi
786     audio/basic au snd
787     audio/midi mid midi kar
788     audio/mpeg mpga mpega mp2 mp3 m4a
789     audio/mpegurl m3u
790     audio/ogg oga spx
791     audio/prs.sid sid
792     audio/x-aiff aif aiff aifc
793     audio/x-gsm gsm
794     audio/x-mpegurl m3u
795     audio/x-ms-wma wma
796     audio/x-ms-wax wax
797     audio/x-pn-realaudio ra rm ram
798     audio/x-realaudio ra
799     audio/x-scpls pls
800     audio/x-sd2 sd2
801     audio/x-wav wav
802     chemical/x-alchemy alc
803     chemical/x-cache cac cache
804     chemical/x-cache-csf csf
805     chemical/x-cactvs-binary cbin cascii ctab
806     chemical/x-cdx cdx
807     chemical/x-cerius cer
808     chemical/x-chem3d c3d
809     chemical/x-chemdraw chm
810     chemical/x-cif cif
811     chemical/x-cmdf cmdf
812     chemical/x-cml cml
813     chemical/x-compass cpa
814     chemical/x-crossfire bsd
815     chemical/x-csml csml csm
816     chemical/x-ctx ctx
817     chemical/x-cxf cxf cef
818     chemical/x-daylight-smiles smi
819     chemical/x-embl-dl-nucleotide emb embl
820     chemical/x-galactic-spc spc
821     chemical/x-gamess-input inp gam gamin
822     chemical/x-gaussian-checkpoint fch fchk
823     chemical/x-gaussian-cube cub
824     chemical/x-gaussian-input gau gjc gjf
825     chemical/x-gaussian-log gal
826     chemical/x-gcg8-sequence gcg
827     chemical/x-genbank gen
828     chemical/x-hin hin
829     chemical/x-isostar istr ist
830     chemical/x-jcamp-dx jdx dx
831     chemical/x-kinemage kin
832     chemical/x-macmolecule mcm
833     chemical/x-macromodel-input mmd mmod
834     chemical/x-mdl-molfile mol
835     chemical/x-mdl-rdfile rd
836     chemical/x-mdl-rxnfile rxn
837     chemical/x-mdl-sdfile sd sdf
838     chemical/x-mdl-tgf tgf
839     chemical/x-mif mif
840     chemical/x-mmcif mcif
841     chemical/x-mol2 mol2
842     chemical/x-molconn-Z b
843     chemical/x-mopac-graph gpt
844     chemical/x-mopac-input mop mopcrt mpc dat zmt
845     chemical/x-mopac-out moo
846     chemical/x-mopac-vib mvb
847     chemical/x-ncbi-asn1 asn
848     chemical/x-ncbi-asn1-ascii prt ent
849     chemical/x-ncbi-asn1-binary val aso
850     chemical/x-ncbi-asn1-spec asn
851     chemical/x-pdb pdb ent
852     chemical/x-rosdal ros
853     chemical/x-swissprot sw
854     chemical/x-vamas-iso14976 vms
855     chemical/x-vmd vmd
856     chemical/x-xtel xtel
857     chemical/x-xyz xyz
858     image/cgm cgm
859     image/g3fax g3
860     image/gif gif
861     image/ief ief
862     image/jpeg jpeg jpg jpe jfif
863     image/pipeg jpeg jpg jpe jfif
864     image/pjpeg jpeg jpg jpe jfif
865     image/pcx pcx
866     image/png png
867     image/svg+xml svg svgz
868     image/tiff tiff tif
869     image/vnd.djvu djvu djv
870     image/vnd.dwg dwg
871     image/vnd.dxf dxf
872     image/vnd.fpx fpx
873     image/vnd.net-fpx fpx
874     image/vnd.wap.wbmp wbmp
875     image/x-cmu-raster ras
876     image/x-coreldraw cdr
877     image/x-coreldrawpattern pat
878     image/x-coreldrawtemplate cdt
879     image/x-corelphotopaint cpt
880     image/x-icon ico
881     image/x-jg art
882     image/x-jng jng
883     image/x-ms-bmp bmp
884     image/x-photoshop psd
885     image/x-portable-anymap pnm
886     image/x-portable-bitmap pbm
887     image/x-portable-graymap pgm
888     image/x-portable-pixmap ppm
889     image/x-rgb rgb
890     image/x-xbitmap xbm
891     image/x-xpixmap xpm
892     image/x-xwindowdump xwd
893     message/rfc822 eml
894     model/iges igs iges
895     model/mesh msh mesh silo
896     model/vnd.dwf dwf
897     model/vrml wrl vrml
898     text/calendar ics icz
899     text/css css
900     text/csv csv
901     text/h323 323
902     text/html html htm shtml sht
903     text/iuls uls
904     text/mathml mml
905     text/plain asc txt text pot
906     text/richtext rtx
907     text/rtf rtf
908     text/scriptlet sct wsc
909     text/texmacs tm ts
910     text/tab-separated-values tsv
911     text/vnd.sun.j2me.app-descriptor jad
912     text/vnd.wap.wml wml
913     text/vnd.wap.wmlscript wmls
914     text/x-bibtex bib
915     text/x-boo boo
916     text/x-c++hdr h++ hpp hxx hh
917     text/x-c++src c++ cpp cxx cc
918     text/x-chdr h
919     text/x-component htc
920     text/x-csh csh
921     text/x-csrc c
922     text/x-dsrc d
923     text/x-diff diff patch
924     text/x-fortran f f77 f90 for
925     text/x-haskell hs
926     text/x-java java
927     text/x-literate-haskell lhs
928     text/x-moc moc
929     text/x-pascal p pas
930     text/x-pcs-gcd gcd
931     text/x-perl pl pm
932     text/x-prolog pl pro prolog
933     text/x-python py
934     text/x-setext etx
935     text/x-sh sh
936     text/x-tcl tcl tk
937     text/x-tex tex ltx sty cls
938     text/x-vcalendar vcs
939     text/x-vcard vcf
940     video/3gpp 3gp
941     video/dl dl
942     video/dv dif dv
943     video/fli fli
944     video/gl gl
945     video/mpeg mpeg mpg mpe
946     video/mp4 mp4
947     video/ogg ogv
948     video/quicktime qt mov
949     video/vnd.mpegurl mxu
950     video/x-la-asf lsf lsx
951     video/x-mng mng
952     video/x-ms-asf asf asx
953     video/x-ms-wm wm
954     video/x-ms-wmv wmv
955     video/x-ms-wmx wmx
956     video/x-ms-wvx wvx
957     video/x-msvideo avi
958     video/x-sgi-movie movie
959     x-conference/x-cooltalk ice
960     x-epoc/x-sisx-app sisx
961     x-world/x-vrml vrm vrml wrl

  ViewVC Help
Powered by ViewVC 1.1.26