W
William
Code in question:
#!/usr/bin/perl -w
use strict;
my $tempfile;
my $upath;
my $savedfilename;
# The following reads in the CGI buffer, and writes it to a temporary file
# which will used later.
read ( STDIN, my $buffer, $ENV{'CONTENT_LENGTH'} );
open ( TEMP_FD,">$tempfile" );
print TEMP_FD $buffer;
close ( TEMP_FD );
open ( TEMPFILE_FD, $tempfile );
# Gotta pull the MIME/multipart separator line out
$_ = <TEMPFILE_FD>; (
my $vernum) = /(\d+)/;
$_ = <TEMPFILE_FD>;
my $filetemp = $1 if (/filename=\"(.*)\"/);
#create the output file in the upload directory
open ( OUTFILE_FD, ">$upath$savedfilename");
close ( TEMPFILE_FD );
close ( OUTFILE_FD );
Question: my above code only uploads 1 file. How do I upload 2 files
simulataenously with the same CGI buffer?
P.S. this script is run from a website with 2 "Browse..." for file
widgets.
#!/usr/bin/perl -w
use strict;
my $tempfile;
my $upath;
my $savedfilename;
# The following reads in the CGI buffer, and writes it to a temporary file
# which will used later.
read ( STDIN, my $buffer, $ENV{'CONTENT_LENGTH'} );
open ( TEMP_FD,">$tempfile" );
print TEMP_FD $buffer;
close ( TEMP_FD );
open ( TEMPFILE_FD, $tempfile );
# Gotta pull the MIME/multipart separator line out
$_ = <TEMPFILE_FD>; (
my $vernum) = /(\d+)/;
$_ = <TEMPFILE_FD>;
my $filetemp = $1 if (/filename=\"(.*)\"/);
#create the output file in the upload directory
open ( OUTFILE_FD, ">$upath$savedfilename");
close ( TEMPFILE_FD );
close ( OUTFILE_FD );
Question: my above code only uploads 1 file. How do I upload 2 files
simulataenously with the same CGI buffer?
P.S. this script is run from a website with 2 "Browse..." for file
widgets.