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.


In reply to upload errors by eoin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.