upload picture: limit size problems
| From: | Matt Hedges | Date: | Thu, 15 Jan 2004 04:03:29 +0000 |
| Subject: | upload picture: limit size problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-174612@lists.php.net to get a copy of this message | ||
Hello,
with ya'lls help I've gotten a php that uploads only a jpg... now I'm trying
to add a constraint that limits the width and size... I've been reading the
manual (don't understand the error_messages)... and can't figure it out...
this is what I have so far:
<?
$base_img_dir = "images/";
$uniq = uniqid("");
$extension=".jpg";
$filename = $base_img_dir.$uniq.$extension;
if(isset( $Submit ))
{
if ($_FILES['imagefile']['type'] == "image/pjpeg"){
move_uploaded_file($_FILES["imagefile"]["tmp_name"], $filename)
or die ("Could not copy");
echo "";
echo "Copy Done....";
}
else {
echo "";
echo "Could Not Copy, Wrong Filetype
(".$_FILES['imagefile']['name'].")";
}
}
I know there's some easy way to do it...
thanks a lot,
Matt