blackcat99
Programmer
I'm having a problem with a Perl upload script called mega-upload v1.45.
The script uploads files using a multipart form into a temporary data file stored on my site (this works fine).
Next I create a new CGI to read the data and parse it into the separate files. However I always get an permission denied error. This only happens on my web server site (and not on my local computer website).
The file directories appear to have RW permissions, and I've tried creating output files directly from the data file (rather than using tempfiles) - but get the same error.
The server uses IIS 5 | PERL: v 5.006001 | CGI.pm: v 2.752
Can anyone help???
------------------------------
The initial code successfully creates a temp file:
------------------------------
$data_file
------------------------------
But here's where the error occurs:
------------------------------
open(STDIN,"< $data_file") or die "can't open file: $! for reading";
my $cg = new CGI();
my $qstring="";
my %vars = $cg->Vars;
my $j=0;
while(($key,$value) = each %vars) {
if(defined $value && $value ne '') {
my $fh = $cg->upload($key);
if(defined $fh) {
($tmp_fh, $tmp_fn) = tempfile();
while(<$fh>) {
print $tmp_fh $_;
}
close($tmp_fh);
}
}
}
The script uploads files using a multipart form into a temporary data file stored on my site (this works fine).
Next I create a new CGI to read the data and parse it into the separate files. However I always get an permission denied error. This only happens on my web server site (and not on my local computer website).
The file directories appear to have RW permissions, and I've tried creating output files directly from the data file (rather than using tempfiles) - but get the same error.
The server uses IIS 5 | PERL: v 5.006001 | CGI.pm: v 2.752
Can anyone help???
------------------------------
The initial code successfully creates a temp file:
------------------------------
$data_file
------------------------------
But here's where the error occurs:
------------------------------
open(STDIN,"< $data_file") or die "can't open file: $! for reading";
my $cg = new CGI();
my $qstring="";
my %vars = $cg->Vars;
my $j=0;
while(($key,$value) = each %vars) {
if(defined $value && $value ne '') {
my $fh = $cg->upload($key);
if(defined $fh) {
($tmp_fh, $tmp_fn) = tempfile();
while(<$fh>) {
print $tmp_fh $_;
}
close($tmp_fh);
}
}
}