You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Charlton Wilbur <cw...@tortus.com> on 2005/10/11 19:02:46 UTC
mp2 & Mason: Apache2::Request says "End of file found" for $req->upload
All,
I'm currently writing some HTML::Mason code to handle file uploads
under mod_perl 1 and mod_perl 2. The uploads are put into a hash
where the keys are the names and the values are either Apache::Upload
objects or Apache2::Upload objects, and further munging happens after
that. Everything works as I expect under mod_perl 1; however, under
mod_perl 2, there is a problem.
As soon as I attempt to call Apache2::Request->upload, all other
execution appears to stop and the browser displays only "End of file
found".
I found this thread in the archives:
http://www.gossamer-threads.com/lists/modperl/modperl/82182
...and while I was writing this I discovered a solution, which I now
provide here in case anyone else is confused.
Current versions of HTML::Mason, while they are running under
mod_perl2, use CGI.pm to decipher arguments. It is possible to
configure HTML::Mason to use Apache::RequestRec and friends by
altering a configuration parameter, as discussed here, under "Common
Problems: Errors Involving Apache2::Request."
http://www.masonhq.com/?ApacheModPerl2
I'm not sure precisely why this happened, but it appears to be most
likely ascribable to differences in what Mason's global $r object
contains when CGI.pm is used to decipher the arguments as opposed to
what the $r object contains when Apache2::Request is used.
Charlton
--
Charlton Wilbur
cwilbur@tortus.com
Re: mp2 & Mason: Apache2::Request says "End of file found" for $req->upload
Posted by Charlton Wilbur <cw...@tortus.com>.
On Oct 11, 2005, at 9:00 PM, Joe Schaefer wrote:
> Charlton Wilbur <cw...@tortus.com> writes:
>
>
>> As soon as I attempt to call Apache2::Request->upload, all other
>> execution appears to stop and the browser displays only "End of file
>> found".
>>
>
> I just patched apreq's trunk (which will be part of 2.07 when
> released)
> so the "End of file Found" problem disappears. Out of curiosity,
> which browser (with version) are you using in your tests?
Safari 2.0.1 (412.5) on OS X 10.4.2.
I'm not sure it's the *same* problem as reported here earlier, mind -
I posted here because it seemed to me that differences between
mod_perl 1 and mod_perl 2 were the root cause -- everything else was
the same. In fact, it is a difference in Mason behavior, and so it
is likely to be the same behavior but for different reasons; when I
figured that out, I posted it here anyway, in the thought that other
people might come to the same erroneous conclusion I had about the
root cause, and search the archives first.
Charlton
--
Charlton Wilbur
cwilbur@tortus.com
Re: mp2 & Mason: Apache2::Request says "End of file found" for $req->upload
Posted by Joe Schaefer <jo...@sunstarsys.com>.
Charlton Wilbur <cw...@tortus.com> writes:
> As soon as I attempt to call Apache2::Request->upload, all other
> execution appears to stop and the browser displays only "End of file
> found".
I just patched apreq's trunk (which will be part of 2.07 when released)
so the "End of file Found" problem disappears. Out of curiosity,
which browser (with version) are you using in your tests?
--
Joe Schaefer