#=================================================================## Iterate over all the keys in the cgi form and pick out the environment# variables we're interested in. Namely, files and location.#foreach $key (sort keys %{$cgi->{form}}){ # # For any name_* key we find, figure out what the type (dir or file) # is and also what the full path to the dir or file is. # This depends on having found a valid $directory_path # if ($key =~ /name_/) { $key_num =~ s/name_//; # # If we find a file, write the file to our growing list of # selected files in the @files array. # If we find a directory, traverse the directory and write # all files in the directory to the @files array. # my $type = $cgi->{form}{"type_".$key_num}; my $path = $cgi->{form}{"path_".$key_num}; if($path =~ /.iwmnt(.*)/) { $path = "/iwmnt" . $1; # New in TS 5.5.2 } if ($type eq "directory") { recurse_dir($path); } elsif($type eq "file") { put_file($path); } }}