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=\"$attach_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)