Hello Peter,

Tuesday, January 13, 2004, 12:25:14 AM, you wrote:

PV> Instead of it being "picture.jpg" it was
PV> "/tmp/progtemp/php/uploads/phpeZQiXd".  Can anyone shed some light
PV> as to how I could check to make sure that only JPEG images get
PV> uploaded ?  Thanks in advance...

The filename isn't always the best way to tell. I mean I could rename
an mp3 to jpg and you'd think it was a jpg and happily insert it into
your database. Instead it's probably better to test the integrity of
the image itself.

If it's available on your web host (and it probably is) use this
function:

getimagesize()

Specifically, look at the 2nd index in the returned array (the image
type).

You could also try: exif_imagetype()

But it depends how PHP has been compiled (it'll need exif support
enabled).

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

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

Reply via email to