Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi,

i am trying to open a pdf with partial content in my apache2 application using mod_perl2
but i didn't get 206 code in access_log and opening as 500 or 200.
from the mod_perl 2 documentation, "automatically taking care of serving the requested ranges off the normal complete response."
please help me how to proceed further

Server version: Apache/2.2.24 (Unix)
Server built: Jun 28 2013 09:29:46
mod_perl/2.0.7

sub send_item { my ($item, $r) = @_; my $fh = $item->{path}; my $attach_name = basename($fh); my $content_size = -s $fh; $r->content_type($item->{mimetype}); $r->set_last_modified; $r->set_content_length($content_size); $r->headers_out->set('Accept-Ranges' => 'bytes'); $r->headers_out->set('Content-Disposition' => "inline; filename=\"$a +ttach_name\""); #After commenting below 2 lines also not getting 206 my $ranges = "bytes=0-".($content_size - 1)."/" . $content_size; $r->headers_out->set('Content-Range' => "$ranges"); unless ((my $status = $r->meets_conditions) == OK) { return $status; } return OK if $r->header_only; $r->sendfile($fh); return OK; }
Output filter dump: -------------------- output_filters: 0(byterange) output_filters: 1(content_length) output_filters: 2(http_header) output_filters: 3(http_outerror) output_filters: 4(log_input_output) output_filters: 5(core)