Hi all, I have a file download routine that I am working with. It works great except that no all files show up.
For example, if I have a .txt file,k it shows, if I have a .doc file, it does not. Can anyone help me out?
Any suggestions appreciated.
Jim
For example, if I have a .txt file,k it shows, if I have a .doc file, it does not. Can anyone help me out?
Any suggestions appreciated.
Jim
Code:
print "<form action=\"download.cgi\" method=\"post\" enctype=\"multipart/form-data\">\n";
print "<font color=\"#552500\" size=\"2\">";
print "Please select a file to download.<p />\n";
opendir(MYDIR, $invDir) or die "Cannot open $invDir: $!";
my @dir= grep(-f,readdir(MYDIR));
closedir(MYDIR);
print "<select name=\"file\" size=\"1\">\n";
print " <option selected value=\"\">Choose one...</option>\n";
foreach my $dirname (sort @dir) {
$temp = "$invDir" . "/$dirname";
$temp =~s|^.*/(.+)\.\w+$|$1|;
print "<option value=\"$dirname\">$temp<br />\n";
}
print "</select>\n";