in reply to Re: cgi and upload_hook
in thread cgi and upload_hook

I'm won't do this as a redirect, but your idea is good - to just add the crucial info to the action string. it's not great, as it's not ok to do it this way in some cases (multiple file upload forms), but for my needs right now it will ensure that i get that field name from the form every time, so i won't be at the mercy of the browser deciding in which order to put my post variables.

your issue of redirection though, that's an odd solution. i think the problem you're trying to solve is that CGI won't expose variables on the url (GET vars) during a POST. my solution to that is as follows:
my $get_cgi = new CGI( $ENV{REDIRECT_QUERY_STRING} || $ENV{QUERY_STRIN +G}); my $cgi = new CGI; #will read ALL of STDIN (file uploads will take tim +e..) my $all_vars = \%{ $cgi->Vars, $get_cgi->Vars }; #GET vars will take p +recedence.
the problem with this code is that if you have multiple fields with the same name you lose some values, but if you have that situation you need to build your own hash more explicitly, by calling $cgi->param on each variable until there's nothing left. but this does illustrate my concept: use 2 cgi instances, one for GET and one for POST and merge them

thanks for your insight [id://daitau]

It's not what you look like, when you're doin' what you’re doin'.
It's what you’re doin' when you’re doin' what you look like you’re doin'!
     - Charles Wright & the Watts 103rd Street Rhythm Band