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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php