Hi,
We are trying to upload multiple files on the server. For this we are reading filenames from a text file and uploading those files in a loop' but below mentioned code is not working please help
#!/usr/bin/perl use CGI qw(:standard); my $cgi = new CGI; my $upload_dir ='/home/gecko/www/htdocs'; my $des_dir ='/home/gecko/geckodev/cgi-bin/uploads'; my $file = $cgi->param('pi_file_name'); my $filename = $file; $filename =~ s/^.*(\\|\/)//g; open(FILELIST,"<$filename") || die print "Fail to upload: $!"; while(<FILELIST>) { $line=$_; chomp($line); my $doc = $line; $doc =~ s/^.*(\\|\/)//g; $line =~ s/^.*(\\|\/)//g; open(OUT,">$upload_dir/$doc") || die print "Fail to upload: $!"; + open(FILELIST1,"<$line") || die print "Fail to upload: $!"; while(<FILELIST1>) { print OUT $_; # print $_; print $cgi->header(); print "<HTML>"; print $_; print "<BODY bgcolor=#FFFFFF>"; print "<BODY bgcolor=#FFFFFF>"; print "</BODY>"; print "</HTML>"; } close(OUT); }
20050606 Janitored by Corion: Added formatting
In reply to Upload Multiple Files by arun_amiable
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |