File downloads when I try mod_perl redirect
- From: "Fn***" <fn***@xxxxxxxxx>
- Date: 28 Aug 2005 11:21:55 -0700
Plat: RedHat, Apache1, mod_perl1
I have the following 2 snippets. The first being a sub from a module,
which redirects. The second being the receiver of the redirect. The
problem is, when it redirects, it forces the browser to download the
file, instead of printing the output of script to the screen. When
this happens, the output is displayed correctly. I also tried sending
the $r->status(REDIRECT). That didn't do anything but make the
response slower. Thanks for any input.
#In Redirect module
sub do_redirect{
#Take in params
my ($url, $r) = @_;
#Get the args from the params
my $content = $r->method eq "POST" ? $r->content : $r->args;
#Set the request method to GET
$r->method("GET");
$r->method_number(M_GET);
#Set the typical headers
$r->headers_in->unset("Content-length");
$r->content_type("text/html");
#Add the content to the response
$r->args($content);
#Do the redirect
$r->internal_redirect_handler($url."?".$content);
}
#Receiver of redirect
$r = shift;
$r->content_type("text/plain\n\n");
$r->print("IN RECEIVER SCRIPT\n\n");
$r->print("YOUR PARAMS ARE:".$r->args."\n\n");
$r->print("REQUEST METHOD WAS:".$r->method."\n\n");
.
- Follow-Ups:
- Re: File downloads when I try mod_perl redirect
- From: monkeyden
- Re: File downloads when I try mod_perl redirect
- Prev by Date: How check DBI version on the server?
- Next by Date: RE: Directory Size
- Previous by thread: How check DBI version on the server?
- Next by thread: Re: File downloads when I try mod_perl redirect
- Index(es):