Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And the code that does the uploads:$basedir = "/home/sites/so/on/etc/";
This works great. So, what I did was make the following change:use CGI; $onnum = 1; while ($onnum != 11) { my $req = new CGI; my $file = $req->param("FILE$onnum"); if ($file ne "") { my $fileName = $file; $fileName =~ s!^.*(\\|\/)!!; $newmain = $fileName; if ($allowall ne "yes") { if (lc(substr($newmain,length($newmain) - 4,4)) ne $theext){ $filenotgood = "yes"; } } if ($filenotgood ne "yes") { open (OUTFILE, ">$basedir/$fileName"); print "$basedir/$fileName<br>"; while (my $bytesread = read($file, my $buffer, 1024)) { print OUTFILE $buffer; } close (OUTFILE); } }
And obviously created a path text field in the form. The script executes, and I do not get any errors in my log file, but the files are also not uploaded. I tried changing the method in the form from Post to Get and that also had no effect. What would I need to do to get this to work...if you need me to post the entire script I can do that as well.$basedir = $FORM{'path'};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing a variable to form submitted?
by $code or die (Deacon) on Jan 11, 2001 at 22:58 UTC | |
|
Re: Changing a variable to form submitted?
by chipmunk (Parson) on Jan 11, 2001 at 22:54 UTC | |
|
Re: Changing a variable to form submitted?
by Chady (Priest) on Jan 12, 2001 at 00:43 UTC |