Hi,
I'm trying to send a file to user using OI like this:
sub my_download {
# ..............
open(F,$filepath) or return NOT_FOUND; # file not found
my $r = $R->apache;
$r->no_cache(1);
$r->content_type('application/octet-stream');
$r->headers_out->set(
'Content-disposition' => 'attachment;filename='.$fileName);
$r->send_http_header;
$r->send_fd(\*F);
close(F);
return OK;
}
I get the file ok, but I also get the HTML output from OI and the
file which is saved on the disk is not usable.
What can I do to get only the file and nothing else?
--
Thanks,
Cornel
|