Originally posted by mdojet
I have an upload script and works fine. But I do not want users upload a picture any larger than 200px X 200px. Where would I put this in the upload script? Any help would be appreciated!
Mike
Hi Mike,
I donno if this is a correct way but it works perfectly, you need to get the image's width and height and then see if thats the picture you want, if yes then upload else echo a msg.
somethihng like this:
// Set your maximum height and width of the picture you want..
$widthX = 200;
$heightX = 200;
list($width_orig, $height_orig) = getimagesize($filename);
if ($widthX == $width_orig && $heightX == $height_orig)
{
//Your Upload image code here
}else{
echo "Can upload only " . $widthX . "x" . $widthX . " dimensions pictures";
}