I have a nice upload script and this is a little part of the code:
if($_FILES['Uploadfile']['type']=="image/jpeg")
{
copy($_FILES['Uploadfile']['tmp_name'],$Uploadpath.$_FILES['Uploadfile']['name']);
}
else
{
echo "Please, upload only jpeg";
}
It works very well, but I want to allow more type files to upload.
I like to use a code like this:
if ($ext==".GIF" || $ext==".JPG" || $ext==".BMP" || $ext==".XLS" || $ext==".DOC" || $ext==".PDF" || $ext==".ZIP")
{
copy($_FILES['Uploadfile']['tmp_name'],$Uploadpath.$_FILES['Uploadfile']['name']);
}
else
{
echo "This type is not allowed !";
}
Does anyone have an idea ?