in reply to How to download a range of bytes?
To get the current content length of the object, you can do a HEAD before and look at the content-length header.#!/usr/bin/perl -w use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $url = 'http://localhost/...'; $ua->default_headers->push_header(Range => "bytes=1000-2000"); my $response = $ua->get($url); my $content = $response->content(); warn length($content); warn $content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to download a range of bytes?
by Zeokat (Novice) on Dec 26, 2007 at 23:47 UTC | |
by Anonymous Monk on Dec 27, 2007 at 00:44 UTC |