I'm stumped. I dunno how things can go so wrong with a print command!!!!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.
Thanks to every one whos helped me make this 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>);
If everything seems to be going well, you obviously don't know what the hell is going on.
In reply to upload errors by eoin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |