Re: Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg"

From: Date: Wed, 23 Nov 2005 16:55:51 +0000
Subject: Re: Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg"
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-226369@lists.php.net to get a copy of this message
On Wed, Nov 23, 2005 at 06:48:25AM +0100, twistednetadmin wrote: > This did the trick: > > elseif ($_FILES['guildimage']['type'] == "image/pjpeg" or > "image/jpeg") Not for reasons you think. The (or "image/jpeg") is going to evaulate as TRUE, so your expression will always be true. For example: var_dump((bool) "image/jpeg"); You should really consider using the fileinfo extension, or mabey even http://php.net/getimagesize. The ['type'] information can't be trusted to be what it says it is. Curt. -- cat .signature: No such file or directory

« previous php.general (#226369) next »