When it comes to the point of checking what kind of extention it has, even if it is a gif I get a error "Your image needs to be in GIF or JPEG format." Anyone know why??@alltypes = qw(.gif .jpg .jpeg .jpe .jfif); if(param('im1') || param('im2') || param('im3') || param('im4') || par +am('im5')) { for ($i=1; $i<=5; $i++) { if (param("im$i")) { $file = param("im$i"); $filename = param("im$i"); $filename =~ s/.*[\/\\]//; $ext = param("im$i"); $ext =~ s/^[^.]*(\.[\w]+$)/$1/; foreach $line (@alltypes) { if(($ext !~ /$line/i)) { error("Your image needs to be in GIF or JPEG format."); } } } } } else { error("You need to upload at least one image!"); }
In reply to Checking File Types by andrew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |