gcw has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I am trying to partially download a PDF with the following mod perl 2 code but I keep on getting a 200 response rather than a 206 response.
sub send{ my ($r) = @_; my $file = "/tmp/out.pdf"; my $file_size = = -s $file; my $attach_name = basename($file); $r->headers_out->set('Accept-Ranges' => 'bytes'); $r->headers_out->set('Content-Disposition' => "inline; filename=\"$a +ttach_name\""); $r->set_content_length($file_size); $r->content_type('application/pdf'); unless ((my $status = $r->meets_conditions) == OK) { return $status; } $r->sendfile($file); return OK; }
If the "Accept Ranges" is present doesn't Apache 2 send the proper headers so that the download is a partial download? Thanks a bunch for any replies!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: partial content download in mod perl 2
by wind (Priest) on Mar 22, 2011 at 05:00 UTC | |
by gcw (Novice) on Mar 22, 2011 at 14:24 UTC |