I have written a small spider which checks a database of webpage
addresses for validity.
It returns the length of a web-page in bytes (supposedly), but I cannot
get it to return the correct length of a PDF file web address
Code is basically:
local ($PageToFetch, $httpname);
# Use LWP module to communicate with the web
page
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 "); # Create a request
my $req = HTTP::Request->new(POST =>
"$PageToFetch",$ContentLen);
$Filel1=$ContentLenub->document_length;
$req->content_type('x-www-form-urlencoded');
$req->content('match=www&errors=0'); #
Pass request to the user agent and get a response back
my $res = $ua->request($req); # Check the outcome of the
response
$PageCheck=0;
$CheckReason="";
if
($res->is_success)
{
# Page address is
valid
$ValidName=1;
$buffer=$res->content;
$Filelen=length ($buffer); # Store filelength - will not grab a pdf file
!!
}
How do I get the length of a pdf file into $Filelen ??
--
Rich
Mellor
RWAP Services
35 Chantry Croft, Kinsley, Pontefract, West
Yorkshire, WF9 5JH
TEL: 01977 610509
Visit our website
at:
URL:http://www.rwapsoftware.co.uk
In need of adventure?
URL:
http://www.rwapadventures.com
Stuck with ordinary dial up internet
connection ??
Read our review of internet accelerators and broadband
at:
URL:http://www.rwapservices.co.uk