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)

In reply to partial content in mod_perl2 and apache2 by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.