I use this line in a script for uploading pictures to a website:
$_FILES['guildimage']['type'] == "image/jpeg"
This works fine when using Mozilla, but it doesn't work with IE.
How should I do it to get it working with both/all browsers?
if (isset($_POST['submit'])) //If you
press submit
{
$sysfolder="/guildimages/";
$filename="".$_FILES['guildimage']['name']."";
if (file_exists($sysfolder . $filename)) //And the
file exists or there is no file chosen
{
echo "Filename exists or no file selected. Please rename the file or select
a file";
}
elseif ($_FILES['guildimage']['type'] == "image/jpeg") //If the
filetype is correct (this is where the change should be I think)
{
copy ($_FILES['guildimage']['tmp_name'],
"/guildimages/".$_FILES['guildimage']['name']) //Copy the file to
folder ("/guildimages")
or die("Could not copy file"); //Or
die
echo "Result:<br>\n";
echo "Filename: ".$_FILES['guildimage']['name']."<br>\n";
echo "Filesize: ".$_FILES['guildimage']['size']." byte<br>\n";
echo "Filtype: ".$_FILES['guildimage']['type']."<br>\n";
echo "Congrats! It worked!\n";
}
else
{
echo "Result:<br>\n";
echo "Now that didn't seem to work... <br>\n
Have you checked the size and filetype? <br>\n
File that failed--> (".$_FILES['guildimage']['name'].")<br>";
}
}
Does anyone know the answer to this?