in reply to Check remote file for size?
#!/usr/bin/perl -w use strict; use LWP::Simple; my $url="http://localhost/index.html"; my $MAX_SIZE=50_000; my ($content_type, $document_length, $modified_time, $expires, $server +)= head($url); if ($document_length>$MAX_SIZE){ print "TooBig, Ignoring\n" } else { my $dl=get($url); print $dl; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Check remote file for size?
by Mosley (Novice) on Oct 13, 2001 at 15:15 UTC |