Hi fellas,
I'm about 2 weeks old in the perl/cgi world and am just starting to figure this out. My file upload code doesn't want to work. When I run the script, the name of the file gets saved in the desired location. However, it always uploads with 0 bytes! Heres the code, any help would be greatly appreciated!
#!/mgs/sw/bin/perl -w
my $attachment1= $q->param('Fileone');
if($attachment1)
{
$attachment1=~ s/.*[\/\\](.*)/$1/;
my $file = $q->upload('Fileone');
my $upload_dir = "../Newswatch/Jobs/$path";
open(UPLOAD, ">$upload_dir/$attachment1"
binmode UPLOAD;
while ($file)
{
print UPLOAD ;
}
close (UPLOAD);
}
I'm about 2 weeks old in the perl/cgi world and am just starting to figure this out. My file upload code doesn't want to work. When I run the script, the name of the file gets saved in the desired location. However, it always uploads with 0 bytes! Heres the code, any help would be greatly appreciated!
#!/mgs/sw/bin/perl -w
my $attachment1= $q->param('Fileone');
if($attachment1)
{
$attachment1=~ s/.*[\/\\](.*)/$1/;
my $file = $q->upload('Fileone');
my $upload_dir = "../Newswatch/Jobs/$path";
open(UPLOAD, ">$upload_dir/$attachment1"
binmode UPLOAD;
while ($file)
{
print UPLOAD ;
}
close (UPLOAD);
}