![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
media_suffix - returns file extentions for a media type
use LWP::MediaTypes qw(guess_media_type); $type = guess_media_type("/tmp/foo.gif");
For backwards compatability we will also look for ~/.mime.types.
The guess_media_type function also accepts a URI::URL object as argument.
If the type can not be deduced from looking at the file name only, then
guess_media_type()
will take a look at the actual file using
the
-T
perl operator in order to determine if this is a text file (text/plain). If
this does not work it will return
application/octet-stream as the type.
type(s).
Wildcard types can be used. In scalar
context it will return the first suffix found.
Examples:
@suffixes = media_suffix('image/*', 'audio/basic'); $suffix = media_suffix('text/html');
$CommentsMailTo = "perl5@dcs.ed.ac.uk"; include("../syssies_footer.inc");?>