TStanley has asked for the wisdom of the Perl Monks concerning the following question:
And now the script:<HTML> <HEAD><TITLE>Upload Form</TITLE></HEAD> <BODY><CENTER> <FORM METHOD="POST" ACTION="cgi-bin/upload.cgi"> File Name: <INPUT TYPE="FILE" NAME="file"> <BR><BR><BR> <INPUT TYPE="SUBMIT" VALUE="Submit"> </FORM> </CENTER></BODY> </HTML>
The error in the log is stating that the $File variable is undefined, which means that the form isn't passing the name. Please just point me in the right direction, and I should be able to handle it from there.#!/usr/bin/perl -w # I am not using taint yet, but when I get # ready to deploy this, it will be there use strict; use CGI; my $Q=new CGI; my $File=$Q->param('file'); # I know what I am sending right now # so when I turn on tainting, the below # regex will DEFINITELY be changing if($File=~/\/root\/text/){ print $Q->header; print $Q->start_html('File is Correct'); print $Q->h1("File is $File"); print $Q->end_html; }else{ print $Q->header; print $Q->start_html('File is Incorrect'); print $Q->h1("File is $File"); print $Q->end_html; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Uploading a file with CGI
by cLive ;-) (Prior) on Sep 15, 2002 at 22:45 UTC | |
|
Re: Uploading a file with CGI
by Kanji (Parson) on Sep 15, 2002 at 22:30 UTC | |
|
Re: Uploading a file with CGI
by Ryszard (Priest) on Sep 16, 2002 at 08:35 UTC | |
|
Re: Uploading a file with CGI
by blm (Hermit) on Sep 16, 2002 at 11:45 UTC |