I have a situation where I need to identify whether a URL is a PDF file or not. Here's an example URL : http://ccdl.libraries.claremont.edu/u?/stc,87 Looking at it, it's not obvious that it links to a PDF.
Here's the relevant code snippet. It is not working though.
Thanks in advance.
use MIME::Types;
my $mt = MIME::Types->new;
my $url="http://ccdl.libraries.claremont.edu/u?/stc,87";
if($mt->mimeTypeOf($url) eq "application/pdf"){
print "$url is a PDF file\n";
}
In reply to Identifying PDF from URLs by listanand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |