How can I set my server's HTTP response to:
HTTP/1.1 206 Partial Content
In PHP I would write header('HTTP/1.1 206 Partial Content') but what about in Perl CGI?
I'm using this code but the client reports an HTTP 500 error
if ( defined $ENV{HTTP_RANGE} ) {
my $startrange = 500;
my $endrange = 900;
$length = $endrange-$startrange;
print qq{HTTP/1.1 206 Partial Content\n};
my $range = $startrange.'-'.$endrange.'/'.$filesize;
print qq{Content-Range: bytes $range\n};
}
print qq{Accept-Ranges: bytes\n};
print qq{Content-Disposition: attachment; filename="$filename"\n};
print qq{Content-length: $length\n\n};
I have checked the error log, which says this:
malformed header from script 'download.cgi': Bad header: HTTP/1.1 206 Partial Content
print qq{HTTP/1.1 206 Partial Content\n};i get 200 OK, i need to get 206 Partial Content for resumable download