Image upload JP filetype

I have an image upload script.

It doesn’t like files that are named with uppercase file extensions i.e. "file.JPG "

Is there an easy way to deal with these

if ((($_FILES["news_item_image"]["type"] == "image/gif")
|| ($_FILES["news_item_image"]["type"] == "image/jpeg")
|| ($_FILES["news_item_image"]["type"] == "image/pjpeg"))
&& ($_FILES["news_item_image"]["size"] < 200000000))

An ideas muchly appreciated.

You really should not be using the “type” information.
Use either:
http://us3.php.net/manual/en/function.exif-imagetype.php
http://us3.php.net/manual/en/function.getimagesize.php

Quite simply it wans’t because the files had uppercase .JPG, that was conicidental. They were just too big.

I am still an idiot.

You could normalise them, or try using [fphp]strcasecmp/fphp.