frinky has asked for the wisdom of the Perl Monks concerning the following question:
Here is the script:<form action="main.cgi?afd=upload" method="post" enctype="multipart/fo +rm-data" name="form" id="form" target="_top"> <input type="file" size=25 name="upload_foto" id="upload_foto" value=" +$filename" tabindex=2> <input type="text" size=25 name="naam" id="naam" value="$naam" tabinde +x=1>
And I'm so very sure it used to work...sub Parse_Form { if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); if ($ENV{'QUERY_STRING'}) { @getpairs =split(/&/, $ENV{'QUERY_STRING'}); push(@pairs,@getpairs); } } else { print "Content-type: text/html\n\n"; print "<P>Use Post or Get"; } foreach $pair (@pairs) { ($key, $value) = split (/=/, $pair); $key =~ tr/+/ /; $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s/<!--(.|\n)*-->//g; if ($formdata{$key}) { ## maakt er een Array van als key al vo +orkomt $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } } if ($naam) { print "Content-type: text/html\n\nGelukt om in die kut-sub te komen."; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can I do a file upload without using any modules?
by Ovid (Cardinal) on Apr 22, 2002 at 01:05 UTC | |
|
Re: Can I do a file upload without using any modules?
by dws (Chancellor) on Apr 22, 2002 at 02:11 UTC | |
|
Re: Can I do a file upload without using any modules?
by clintp (Curate) on Apr 22, 2002 at 01:47 UTC | |
by samtregar (Abbot) on Apr 22, 2002 at 04:43 UTC | |
|
Re: Can I do a file upload without using any modules?
by samtregar (Abbot) on Apr 22, 2002 at 04:48 UTC | |
|
Re: Can I do a file upload without using any modules?
by beebware (Pilgrim) on Apr 22, 2002 at 14:38 UTC |