Dear Monks,
I've had quite few problems with my whole project,
here,
here and
here
As of late its been working grand but I changed a few things (of no relivence really). Nothing big. Maybe I deleted a char somewhere with out noticing??
Anywho, when I run this script it creates the folder and uploads the file but it seems to get stuck when it reaches the print command. I get a server error page instead of my html, such as
Internal Server Error
The server encountered an internal error or misconfiguration and was u
+nable to complete your request.
Please contact the server administrator, support@netfirms.com and info
+rm them of the time the error occurred, and anything you might have d
+one that may have caused the error.
More information about this error may be available in the server error
+ log.
I'm stumped. I dunno how things can go so wrong with a print command!!!!
Heres the script
#!/usr/bin/perl -wT
use strict;
use warnings;
use diagnostics;
use File::Spec::Functions;
use CGI qw(:standard);
open LOG, ">logfile" or die;
our $ALBUM_DIR = "../www/albums";
my $user = param("user");
my ($album) = param("T1"); #=~ /([\w ]+)/; # Untaint the album dir nam
+e
my $albumdir = catdir( $ALBUM_DIR, $album );
unless ( -d $albumdir ) {
mkdir $albumdir, 0775;
}
my @pics;
for ( '', 0 .. 19 ) {
push @pics, {
idx => $_,
name => (param("photo$_") =~ /.+([\w. ]+)/)[0],
fh => upload("photo$_")
};
}
foreach my $pic (@pics) {
my $name = $pic->{'name'};
my $fh = $pic->{'fh'};
my $idx = $pic->{'idx'};
my $filenm = catfile( $albumdir, "pic$idx.img" );
print LOG $idx . "\n";
unless($fh eq undef){
local *IMAGE;
open IMAGE, ">", $filenm
or die "Couldn't open $filenm for writing: $!";
binmode IMAGE;
while (my $line = <$fh>) {
print IMAGE $line
or die "Couldn't write to $filenm: $!";
}
close IMAGE
or die "Couldn't close $filenm while writing: $!";
}
}
close(LOG);
print qq(Content-type: text/html\n
<HTML><HEAD>
<META HTTP-EQUIV="refresh" CONTENT="01;URL=http://eoinmurphy00.netfirm
+s.com/cgi-bin/albums.cgi?status=viewall&album=$album&user=$user">
</head><body></body></html>);
Thanks to every one whos helped me make this script.
Appriciate any help at all.
All the Best, Eoin...
If everything seems to be going well, you obviously don't know what the hell is going on.