The following code creates two Input types - a "file select" and a "text
input". The "text input" data is returned as expected whilst the "file
select" data is ignored. I have not found any references for a CGI "file
select" form tag in my documentation so I guess it is not a recognised
tag.
 
How can I achieve a returned selected filename within a simple CGI
script?
 
#!c:/perl/bin/perl.exe -wT
 
use strict;
 
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Test</TITLE></HEAD>";
 
print "
    <FORM>
    <P><INPUT type=\"file\" value=\"file\">
    <INPUT type=\"text\" name=\"words\" value=\"default\" size=\"10\"
maxlength=\"15\">
    <INPUT type=\"submit\" name=\"file\" value=\"Apply\"></P>
    <P>The file is: $ENV{QUERY_STRING}.</P>
    </BODY>
    </HTML>
    </FORM>
    ";

Thanks
NJH

Reply via email to