Re: File Uploading Security - Urgent please

From: Date: Thu, 11 Jan 2001 18:29:50 +0000
Subject: Re: File Uploading Security - Urgent please
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-34060@lists.php.net to get a copy of this message
I seem to dimly remember a lib that somene wrote which will actually check the headers in the files to make _absolutely_ sure you're actually loading a jpeg, gif, etc etc. it was very cool :) _alex -- Alex Black, Head Monkey enigma@turingstudio.com The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 > From: matt@yewlands.com ("Matt Williams") > Newsgroups: php.general > Date: 11 Jan 2001 03:11:21 -0800 > Subject: RE: [PHP] File Uploading Security - Urgent please > > > if(ereg("jpg|jpeg|gif$",$userfile_name)) > { > do something > } > else > { > this file is not allowed > } > This will check that the uploaded file has the correct extension. > > Where $userfile is the upload field name in the form > > M@ >> -----Original Message----- >> From: Statbat [mailto:statbat@gem.net.pk] >> Sent: 11 January 2001 11:00 >> To: PHP-General >> Subject: [PHP] File Uploading Security - Urgent please >> >> >> Hello, >> >> I am doing file uploading of only jpg file format, It first copys >> in tmp directory then I copy it in main.... well you all know the >> procedure... neways what I am concerned is how can I check that >> the file in temp is correct file and is safe for me to copy it in >> the main folder? >> >> Regards >> Statbat >> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#34060) next »