[PHP] getimagesize() to find type?

2004-01-16 Thread Matt Hedges
On Friday 16 January 2004 10:32, Matt Hedges wrote:

 if ($_FILES['imagefile']['type'] != image/pjpeg)

The 'type' in $_FILES is provided by the browser. IIRC only IE uses
image/pjpeg whilst other browsers use  image/jpeg. But regardless of
what
the browser sets, it is more reliable to get the image type from
getimagesize().


(1)  How would I do that (use getimagesize() instead to find type)?



(2)  Stupid question:  how do I say

if ($_FILES['imagefile']['type'] != image/pjpeg)

and add image/jpeg to that constraint?


thanks
Matt




-- 


-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize() to find type?

2004-01-16 Thread Matt Matijevich
[snip]
(1)  How would I do that (use getimagesize() instead to find type)?
[/snip]

http://php.net/getimagesize


[snip]
(2)  Stupid question:  how do I say

if ($_FILES['imagefile']['type'] != image/pjpeg)

and add image/jpeg to that constraint?
[/snip]

there are many ways, I will show you an easy one

if ($_FILES['imagefile']['type'] != image/pjpeg 
$_FILES['imagefile']['type'] != image/jpeg)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php