Re: image validation

From: Date: Sun, 08 Apr 2001 11:57:15 +0000
Subject: Re: image validation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47643@lists.php.net to get a copy of this message
On Sunday 08 April 2001 03:57, you wrote: > I'm wondering if there is any sure way for PHP to determine whether an > uploaded file is definitely an image file. > > I have a script that checks for size and mime type ('image/png' or > 'image/jpeg'). The script works fine, but I've heard that it is > possible to add those mime type headers to files that aren't images at > all, and possibly something mailicious. Well, if you get some images you won't try to execute them (images off bill gates aside :), right? So you don't really have to worry about "something malicious". But if you want to check, just try opening them with one of the image extensions (gd, imagemagick, ...) -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) void sleep(){for(long int sheep=0;!asleep();sheep++);}

« previous php.general (#47643) next »