the html form is to take the file name upload it to the cgi script and then the file is to be passed on to a perl program to be used in execution there.
the form
<!Form to upload a text file to generate a script .>
<HTML>
<HEAD>
<TITLE>Uploading File</TITLE>
</HEAD>
<BODY>
<FONT size=6 type="ariel" color = #0000FF align ="center">Please click browse to Upload the File</FONT>
<TABLE width="510" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr><td align="left" valign="top" height="20">
<FORM METHOD = POST ACTION =" ENCTYPE="multipart/form-data">
Local File: <INPUT TYPE ="file" value= "UPLOAD" ACCEPT="text/plain,image/gif">
</td></tr><br>
<tr><td align="left" valign="top" height="20"><br>
&#032;&#032;<INPUT TYPE = "submit" value ="Transfer File">
<INPUT TYPE = "reset" value= "Reset ">
</td></tr>
</FORM>
</TABLE>
</BODY></HTML>
the cgi script which i am still trying to understand and write.So it still has a lot of loose ends.
#!/usr/local/bin/perl
print "Content-type:text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$FORM{$name} = $value;
}
print "$value \n";
print "<html><head><title>Form Output</title></head><body>";
print "<h2>Results from FORM post</h2>\n";
foreach $key (keys(%FORM)) {
print "$key = $FORM{$key}<br>";
}
print "</body></html>";
~
from this script i want to pass the file to the perl program and use the data in the text file passed
thanks for the help
the form
<!Form to upload a text file to generate a script .>
<HTML>
<HEAD>
<TITLE>Uploading File</TITLE>
</HEAD>
<BODY>
<FONT size=6 type="ariel" color = #0000FF align ="center">Please click browse to Upload the File</FONT>
<TABLE width="510" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr><td align="left" valign="top" height="20">
<FORM METHOD = POST ACTION =" ENCTYPE="multipart/form-data">
Local File: <INPUT TYPE ="file" value= "UPLOAD" ACCEPT="text/plain,image/gif">
</td></tr><br>
<tr><td align="left" valign="top" height="20"><br>
&#032;&#032;<INPUT TYPE = "submit" value ="Transfer File">
<INPUT TYPE = "reset" value= "Reset ">
</td></tr>
</FORM>
</TABLE>
</BODY></HTML>
the cgi script which i am still trying to understand and write.So it still has a lot of loose ends.
#!/usr/local/bin/perl
print "Content-type:text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$FORM{$name} = $value;
}
print "$value \n";
print "<html><head><title>Form Output</title></head><body>";
print "<h2>Results from FORM post</h2>\n";
foreach $key (keys(%FORM)) {
print "$key = $FORM{$key}<br>";
}
print "</body></html>";
~
from this script i want to pass the file to the perl program and use the data in the text file passed
thanks for the help