Re: [mp1] post2get and multipart/form-data
[prev]
[thread]
[next]
[Date index for 2005/05/07]
Hi Stas,
Thanks for responding.
> >this work I convert POST requests to GET requests (so the parameters are
> >not lost, based on a Geoff-example) and make sure that they get populated
> >to the subrequest (via a transhandler). This works... worked :-(
>
> what has changed since it was working?
What changed was the way CGI.pm is working. Since some version in the
history it started to use XHTML as default and with it Lincoln changed
the default encoding to multipart/form-data. As I said, this behaviour
can be changed, but that mechanism does not co-operate reliably with
mod_perl. Anyhow, I gather that wanting to support uploads kind of makes
it necessary to use multipart posts.
> >I try to avoid using it because (a) it is heavy (is it?),
>
> you must be kidding, Frank. libapreq heavy? it's much lighter and faster
> than CGI.pm, check the benchmarks:
Yep, sorry - didn't mean it lik that. I compared using APR to not using
it at all. When I use CGI I do this because I "like" the way it handles
forms and allows me to perl-code HTML. It is possible however that I
turn away from CGI.pm as well though.
> >(b) it eats POST data in a way that CGI can no longer handle it properly,
> right, which is why you should move to Apache2, where it doesn't happen.
>
> (c) if I want to change to Apache2 every usage of APR must be rechecked.
> what do you mean?
Combining the two: the last time I looked into using Apache2 was more than
half a year ago. At that time there was no Apache::Request and, contrary
to what you might deduce from my writing above, I use(d) it in rather a
lot of places. Oh and... I have your (and co-author) Practical Guide to
mod_perl and Geoffs (and co-author) Cookbook, use those rather heavily and
lack good books on mp2. So perhaps I am also a bit afraid of the dark...
BTW - while speaking to you on this subject ;-): while searching for this
issue I found, on the perl.apache.org website
(http://perl.apache.org/docs/1.0/guide/snippets.html#Reusing_Data_from_POST_request)
the text "But what do we do with large multipart file uploads? [...]
switch the request method from POST to GET, and store the POST data
in the query string. This handler does exactly this:"
AFAIK now this is incorrect. Seen the rest of the text, it should better
read:
"As long as you do not use multipart/form-data encoded POSTs (like with
file uploads) you can also alter the request. A transparent..."
Do you agree? To whom and how should I send such a correction?
Bye!
Frank