MIME::Types man page on OpenServer

Man page or keyword search:  
man Server   5388 pages
apropos Keyword Search (all sections)
Output format
OpenServer logo
[printable version]

MIME::Types(3)	      User Contributed Perl Documentation	MIME::Types(3)

NAME
       MIME::Types - Definition of MIME types

INHERITANCE
	MIME::Types
	  is an Exporter

SYNOPSIS
	use MIME::Types;
	my $mimetypes = MIME::Types->new;
	my MIME::Type $plaintext = $mimetypes->type('text/plain');
	my MIME::Type $imagegif	 = $mimetypes->mimeTypeOf('gif');

DESCRIPTION
       MIME types are used in MIME compliant lines, for instance as part of
       e-mail and HTTP traffic, to indicate the type of content which is
       transmitted.  Sometimes real knowledge about a mime-type is need.

       This module maintains a set of MIME::Type objects, which each describe
       one known mime type.  There are many types defined by RFCs and vendors,
       so the list is long but not complete.  Please don't hestitate to ask to
       add additional information.

METHODS
       Instantiation

       MIME::Types->new(OPTIONS)

	   Create a new "MIME::Types" object which manages the data.  In the
	   current implementation, it does not matter whether you create this
	   object often within your program, but in the future this may
	   change.

	    Option	 --Default
	    only_complete  <false>

	   . only_complete => BOOLEAN

	       Only include complete MIME type definitions: requires at least
	       one known extension.  This will reduce the number of entries
	       --and with that the amount of memory consumed-- considerably.

	       In your program you have to decide: the first time that you
	       call the creator ("new") determines whether you get the full or
	       the partial information.

       Knowledge

       $obj->addType(TYPE, ...)

	   Add one or more TYPEs to the set of known types.  Each TYPE is a
	   "MIME::Type" which must be experimental: either the main-type or
	   the sub-type must start with "x-".

	   Please inform the maintainer of this module when registered types
	   are missing.	 Before version MIME::Types version 1.14, a warning
	   was produced when an unknown IANA type was added.  This has been
	   removed, because some people need that to get their application to
	   work locally... broken applications...

       $obj->extensions

	   Returns a list of all defined extensions.

       $obj->mimeTypeOf(FILENAME)

	   Returns the "MIME::Type" object which belongs to the FILENAME (or
	   simply its filename extension) or "undef" if the file type is
	   unknown.  The extension is used, and considered case-insensitive.

	   In some cases, more than one type is known for a certain filename
	   extension.  In that case, one of the alternatives is chosen at ran-
	   dom.

	   Example: use of mimeTypeOf()

	    my MIME::Types $types = MIME::Types->new;
	    my MIME::Type  $mime = $types->mimeTypeOf('gif');

	    my MIME::Type  $mime = $types->mimeTypeOf('jpg');
	    print $mime->isBinary;

       $obj->type(STRING)

	   Return the "MIME::Type" which describes the type related to STRING.
	   One type may be described more than once.  Different extensions is
	   use for this type, and different operating systems may cause more
	   than one "MIME::Type" object to be defined.	In scalar context,
	   only the first is returned.

       $obj->types

	   Returns a list of all defined mime-types

FUNCTIONS
       The next functions are provided for backward compatibility with
       MIME::Types versions 0.06 and below.  This code originates from Jeff
       Okamoto okamoto@corp.hp.com and others.

       by_mediatype(TYPE)

	   This function takes a media type and returns a list or anonymous
	   array of anonymous three-element arrays whose values are the file
	   name suffix used to identify it, the media type, and a content
	   encoding.

	   TYPE can be a full type name (contains '/', and will be matched in
	   full), a partial type (which is used as regular expression) or a
	   real regular expression.

       by_suffix(FILENAME|SUFFIX)

	   Like "mimeTypeOf", but does not return an "MIME::Type" object. If
	   the file +type is unknown, both the returned media type and encod-
	   ing are empty strings.

	   Example: use of function by_suffix()

	    use MIME::Types 'by_suffix';
	    my ($mediatype, $encoding) = by_suffix 'image.gif';

	    my $refdata =  by_suffix 'image.gif';
	    my ($mediatype, $encoding) = @$refdata;

       import_mime_types

	   This method has been removed: mime-types are only useful if under-
	   stood by many parties.  Therefore, the IANA assigns names which can
	   be used.  In the table kept by this "MIME::Types" module all these
	   names, plus the most often used termporary names are kept.  When
	   names seem to be missing, please contact the maintainer for inclus-
	   sion.

SEE ALSO
       This module is part of MIME-Types distribution version 1.20, built on
       June 08, 2007. Website: http://perl.overmeer.net/mimetypes/

LICENSE
       Copyrights 1999,2001-2007 by Mark Overmeer. For other contributors see
       ChangeLog.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.  See
       http://www.perl.com/perl/misc/Artistic.html

perl v5.8.8			  2007-06-08			MIME::Types(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OpenServer

List of man pages available for OpenServer

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net