schalker has asked for the wisdom of the Perl Monks concerning the following question:
but unfortunately the content-length header is missing in this particular example. So my question: is there any other way of checking the size of a remote file via HTTP? Am I missing something? TIA!$ua = LWP::UserAgent->new; # [..] cookies setting skipped $request = HTTP::Request->new("HEAD"); $request->url("http://www.emusic.com/whatever.mp3"); # replace with real MP3 file $response = $ua->request($request); print "dooh" if !defined($response->headers->content_length);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: missing content-length
by arhuman (Vicar) on Jan 22, 2001 at 20:53 UTC | |
by Anonymous Monk on Jan 22, 2001 at 21:12 UTC | |
|
Re: missing content-length
by mr.nick (Chaplain) on Jan 22, 2001 at 21:06 UTC | |
by schalker (Initiate) on Jan 22, 2001 at 21:20 UTC | |
|
Re: missing content-length
by Rune (Initiate) on Jan 26, 2001 at 18:12 UTC |