Re: need help with uploading images

From: Date: Mon, 29 Jul 2002 05:27:47 +0000
Subject: Re: need help with uploading images
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110097@lists.php.net to get a copy of this message
Hi, Monday, July 29, 2002, 7:53:30 AM, you wrote: D> I'm trying to get an uploader to work, where you check to make sure it's a D> jpeg file that's being uploaded, and no other files allowed. the server is D> unix linux using php4.1 D> Any help would be appreciated. D> thanks in advance D> deasdam This may work: $im = getimagesize('anchor.jpg'); if($im[2] == 2 && $im[0] > 0 && $im[1] > 0) echo 'Found a JPEG <br>'; or even this; if($fd = fopen('test.jpg', "r")): fseek($fd,6); $f = fread($fd,4); if($f == "JFIF") echo "JPEG <br>"; fclose ($fd); endif; -- regards, Tom

« previous php.general (#110097) next »