RES: Why does this CGI process hang?
by Ricardo C A de Basto other posts by this author
Aug 28 2001 4:40AM messages near this date
view in the new Beta List Site
Why does this CGI process hang?
|
Re: Prototype mismatch
> while (<$input{file}>) {
> print;
> }
If the value of $input{file} is not false (not empty or zero), this will
loop forever, just like in:
while (1) {
[...]
}
Didn't you mean:
open FILE, $input{file};
while (<FILE> ) {
print;
}
close FILE;
Regards,
Ricardo Basto
-----Mensagem original-----
De: perl-win32-web-admin@[...].com
[mailto:perl-win32-web-admin@[...].com]Em nome de
Kamphuys, ing. K.G.
Enviada em: segunda-feira, 27 de agosto de 2001 09:13
Para: 'perl-win32-web@listserv.ActiveState.com'
Assunto: Why does this CGI process hang?
Hi all,
I'm trying to make a form submit the contents of a file to a CGI script.
Problem is that the process hangs and eventually dies in a CGI timeout
message from my server (IIS4 on NT4) when submitting a very small - 200
bytes) - textfile (so I didn't test for larger ones).
This is the form:
<FORM METHOD="post" ACTION="/cgi-bin/test.pl" ENCTYPE="multipart/form-data"
>
<input type="file" name="file">
<input type="submit" value="upload">
</FORM>
This is test.pl:
use CGI;
$query = new CGI(\*STDIN);
print $query-> header;
@names = $query-> param;
for $name (@names) {
$input{$name} = $query-> param($name);
}
for $key (keys %input) {
print "$key --> $input{$key}<br>";
}
while (<$input{file}> ) {
print;
}
I deliberately left out all kind of HTML printing crap to keep the example
simple.
What's wrong with this one?
Thanks in advance,
Koen Kamphuys
_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
Thread:
Kamphuys, ing. K.G.
Ricardo C A de Basto
|