Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ASP

POST not working

 

 

ModPerl asp RSS feed   Index | Next | Previous | View Threaded


victor at casnt

Jan 15, 2012, 11:04 AM

Post #1 of 4 (2599 views)
Permalink
POST not working

POST method is not working when I use Apache::ASP.
My setup is like this:
- global.asa

use CGI;
our ($cgi);
sub Script_OnStart {$cgi = new CGI;}
sub Script_OnFlush {}

- Apache containts the following setup for ASP

AddHandler cgi-script .cgi
<Files ~ (\.cgi)>
AddHandler perl-script .cgi
PerlHandler Apache::ASP
</Files>
PerlSetVar Global /tmp

- and my test script "test_post.cgi"

<%
use CGI;
print "[1]test is ".$cgi->param("test")."<br>";
print "
<form action=test_post.cgi method=post>
<input type=text name=test>
<input type=submit>
</form>
";
%>

When I run the script I should get the value of the test variable but
$cgi->param("test") is always empty.
GET method is working fine.
How can I fix this?

Thanj you.


victor at casnt

Jan 15, 2012, 11:28 AM

Post #2 of 4 (2496 views)
Permalink
Re: POST not working [In reply to]

I found a solution by adding "PerlSetVar RequestBinaryRead Off" to my
apache config.


On 15.01.2012 21:04, Sterpu Victor wrote:
> POST method is not working when I use Apache::ASP.
> My setup is like this:
> - global.asa
>
> use CGI;
> our ($cgi);
> sub Script_OnStart {$cgi = new CGI;}
> sub Script_OnFlush {}
>
> - Apache containts the following setup for ASP
>
> AddHandler cgi-script .cgi
> <Files ~ (\.cgi)>
> AddHandler perl-script .cgi
> PerlHandler Apache::ASP
> </Files>
> PerlSetVar Global /tmp
>
> - and my test script "test_post.cgi"
>
> <%
> use CGI;
> print "[1]test is ".$cgi->param("test")."<br>";
> print "
> <form action=test_post.cgi method=post>
> <input type=text name=test>
> <input type=submit>
> </form>
> ";
> %>
>
> When I run the script I should get the value of the test variable but
> $cgi->param("test") is always empty.
> GET method is working fine.
> How can I fix this?
>
> Thanj you.


arnon at back2front

Feb 6, 2012, 5:09 PM

Post #3 of 4 (2445 views)
Permalink
Re: POST not working [In reply to]

Thanks for this, ran into the same issue, and that fix worked perfectly.

Note: This affects forms processed using CGI that are submitted with
method="post" and enctype="application/x-www-form-urlencoded" (the default).
Using method="get" or enctype="multipart/form-data" does not cause the problem,
so may be another solution for some.



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe [at] perl
For additional commands, e-mail: asp-help [at] perl


tsirkin at gmail

Feb 7, 2012, 3:05 AM

Post #4 of 4 (2447 views)
Permalink
Re: POST not working [In reply to]

I am not sure ,but it looks like BinaryRead will just read STDIN/mod_perl
buffer
entirely into internal buffer .While getting multipart/form-data a CGI
object
is used to read a file upload.
This is just an explanation ,is that OK ?I guess yes.
Evgeny

On Tue, Feb 7, 2012 at 3:09 AM, Arnon Weinberg <arnon [at] back2front> wrote:

>
> Thanks for this, ran into the same issue, and that fix worked perfectly.
>
> Note: This affects forms processed using CGI that are submitted with
> method="post" and enctype="application/x-www-form-urlencoded" (the
> default).
> Using method="get" or enctype="multipart/form-data" does not cause the
> problem,
> so may be another solution for some.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe [at] perl
> For additional commands, e-mail: asp-help [at] perl
>
>

ModPerl asp RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.