I'm not posting the subroutines because I never manage to reach them. I get stopped with "Not seeing the filetype: ", but $ext seems to be empty by the time I get there. I tried messing around with the scope of $ext (removing "use strict;" and "my"), to no avail. And yes, yes: I realize that I'm running with this on a Windows machine. Any help would be most appreciated. Thank you, kind monks. Cheers, K.#!C:\Perl\bin\perl.exe -wT ## use strict; use warnings; use CGI; use CGI::Carp qw/fatalsToBrowser/; use File::Basename; $CGI::POST_MAX = 1024*5000; $CGI::DISABLE_UPLOADS = 0; my $query = CGI->new; my $safeCharacters = 'a-zA-Z0-9_.-'; my $uploadDirectory = 'C:/Apache/htdocs/notoriousteaze.com/Images/Temp +'; my $originalImage = $query->param("Image"); my ($filename, undef, $ext) = fileparse($originalImage, qr({\..*})); $filename .= $ext; $filename =~ tr/ /_/; $filename =~ s/[^$safeCharacters]//g; if ($filename =~ /^([$safeCharacters]+)$/) { $filename = $1; } else { error("That file name doesnt work for me. $filename"); } my $uploadFilename = $query->upload("Image"); open(UPLOADFILE, ">$uploadDirectory/$filename") or error('Could Not Up +load File.'); while ( <$uploadFilename> ) { print UPLOADFILE; } close UPLOADFILE; my %resizeFileType = ( ".jpeg" => \&resizeJpeg, ".jpg" => \&resizeJpeg, ".gif" => \&resizeGif, ".png" => \&resizePng, ); if(defined ($resizeFileType{$ext}) { $resizeFileType{$ext}->(); } else { error("Not seeing the filetype: $ext"); }
In reply to A Wayward Variable by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |