Unix and Linux Discussions Tagged with mime |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
1,143 |
Software Releases - RSS News |
|
|
|
0 |
1,400 |
Software Releases - RSS News |
|
|
|
0 |
2,211 |
Shell Programming and Scripting |
|
|
|
2 |
9,113 |
Shell Programming and Scripting |
|
|
|
2 |
14,877 |
Shell Programming and Scripting |
|
|
|
0 |
967 |
Software Releases - RSS News |
|
|
|
3 |
19,503 |
Shell Programming and Scripting |
|
|
|
0 |
1,790 |
Shell Programming and Scripting |
|
|
|
0 |
826 |
Software Releases - RSS News |
|
|
|
0 |
809 |
Software Releases - RSS News |
|
|
|
0 |
1,038 |
Software Releases - RSS News |
|
|
|
0 |
1,018 |
Software Releases - RSS News |
|
|
|
0 |
995 |
Software Releases - RSS News |
|
|
|
0 |
989 |
Software Releases - RSS News |
|
|
|
0 |
1,105 |
Security Advisories (RSS) |
|
|
|
0 |
1,433 |
Software Releases - RSS News |
|
|
|
0 |
1,248 |
Software Releases - RSS News |
|
|
|
0 |
1,010 |
Software Releases - RSS News |
|
|
|
4 |
4,443 |
Shell Programming and Scripting |
|
|
|
2 |
3,084 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
12,156 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,676 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
13,882 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
10,205 |
UNIX for Dummies Questions & Answers |
|
|
|
9 |
114,714 |
How do I send email? |
|
|
|
9 |
10,188 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
8,731 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
65,346 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
6,755 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
5,439 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
28,549 |
How do I send email? |
|
|
|
4 |
4,730 |
UNIX for Dummies Questions & Answers |
Dancer::MIME(3pm) User Contributed Perl Documentation Dancer::MIME(3pm)
NAME
Dancer::MIME - Singleton object to handle MimeTypes
SYNOPSIS
# retrieve object instance
my $mime = Data::MIME->instance();
# return a hash reference of user defined types
my $types = $mime->custom_types;
# return the default mime-type for unknown files
$mime->default
# set the default mime-type with Dancer::Config or Dancer, like
set default_mime_type => "text/plain";
# or directly in your config.yml file.
# add non standard mime type
$mime->add_type( foo => "text/foo" );
# add an alias to an existing type
$mime->add_alias( bar => "foo" );
# get mime type for standard or non standard types
$nonstandard_type = $mime->for_name('foo');
$standard_type = $mime->for_name('svg');
# get mime type for a file (given the extension)
$mime_type = $mime->for_file("foo.bar");
PUBLIC API
instance
my $mime = Dancer::MIME->instance();
return the Dancer::MIME instance object.
add_type
# add nonstandard mime type
$mime->add_type( foo => "text/foo" );
Add a non standard mime type or overrides an existing one.
add_alias
# add alias to standard or previous alias
$mime->add_alias( my_jpg => 'jpg' );
Adds an alias to an existing mime type.
for_name
$mime->for_name( 'jpg' );
Retrieve the mime type for a standard or non standard mime type.
for_file
$mime->for_file( 'file.jpg' );
Retrieve the mime type for a file, based on a file extension.
custom_types
my $types = $mime->custom_types;
Retrieve the full hash table of added mime types.
name_or_type
my $type = $mime->name_or_type($thing);
Resolves the $thing into a content $type whether it's the name of a MIME type like "txt" or already a mime type like "text/plain".
AUTHORS
This module has been written and rewritten by different people from Dancer project.
LICENCE
This module is released under the same terms as Perl itself.
SEE ALSO
Dancer
perl v5.14.2 2011-11-30 Dancer::MIME(3pm)