Hi,
Just doing a simple image (jpeg) upload to a directory. Have a script which works fine on one server but comes up with 'wrong file type' on another server.
The server that works has php5 installed, the other is 4.2.2 but I am sure what I have should work on both.
$allowed_types = array('image/jpg','image/jpeg','image/gif','image/png');
if(isset( $Upload ))
{
if(in_array($_FILES['imagefile']['type'],$allowed_types))
{
$_FILES['imagefile']['name'] = "brusca.jpg";
copy ($_FILES['imagefile']['tmp_name'], "../directory is set for chmod 777/".$_FILES['imagefile']['name'])
or die ("Could not copy");
echo "";
echo "Name: ".$_FILES['imagefile']['name']."";
echo "Size: ".$_FILES['imagefile']['size']."";
echo "Type: ".$_FILES['imagefile']['type']."";
echo "Copy Done....";
}
else
{
echo "";
echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")";
}
}
anything server wise (.ini) that may be messing with this??