S
spp
hello ,
I am using LWP::MeidaTypes package to get the mediatype. If it doesnt
recognize the type it returns media type as: application/octet-stream.
I am using its add_type function to add some extentions like bmp, php
etc. but its add_type doesnt seem to be working.
or may be I am doing something wrong.
My code :
use LWP::MediaTypes qw(add_type guess_media_type);
add_type("text/special")=>qw(shtml php htm);
add_type("image/special")=>qw(bmp png jpeg);
my $type = guess_media_type("http://www.cnn.com/abc.php" );
print "media type is". $type;
#
if i run this it prints media type is application/octet-stream
can anyone please tell me what am I doing wrong?
Thanks in advance,
SP
I am using LWP::MeidaTypes package to get the mediatype. If it doesnt
recognize the type it returns media type as: application/octet-stream.
I am using its add_type function to add some extentions like bmp, php
etc. but its add_type doesnt seem to be working.
or may be I am doing something wrong.
My code :
use LWP::MediaTypes qw(add_type guess_media_type);
add_type("text/special")=>qw(shtml php htm);
add_type("image/special")=>qw(bmp png jpeg);
my $type = guess_media_type("http://www.cnn.com/abc.php" );
print "media type is". $type;
#
if i run this it prints media type is application/octet-stream
can anyone please tell me what am I doing wrong?
Thanks in advance,
SP