if I have to guess, I think the trouble lines are in this block. Notice that there are duplicate else statements. Usually PHP will raise "unexpected T_ELSE..." error
if(mysql_affected_rows($conn)>0)
{
echo"status:Uploaded";
$last_insert_id = mysqli_insert_id($conn);
}
else
{
echo "Status: failed to Upload";
}
else
{
echo "File not allowed";
}