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:[EMAIL PROTECTED]]
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]