Thanks for the replies, it seems i'm still having problems though, i'm trying to use the code below but having no luck. It says "Could Not Copy, Wrong Filetype (gif.gif)" and i'm trying to upload a gif so why is this happening any ideas. I don't think it's recognising the image type as image/gif, any reason why this would be?
<?
echo"
<form name='form1' method='post' action='' enctype='multipart/form-data'>
<input type='file' name='image'>
<br>
<input type='submit' name='submit' value='Submit'>";
if(isset( $submit ))
{
//If the Submitbutton was pressed do:
if ($_FILES['image']['type'] == "image/gif")
{
copy ($_FILES['image']['temp_name'], "images/directory/".$_FILES['image']['name'])
or die ("Could not copy");
}
echo "";
echo "Name: ".$_FILES['image']['name']."";
echo "Size: ".$_FILES['image']['size']."";
echo "Type: ".$_FILES['image']['type']."";
echo "Copy Done !";
}
else {
echo "<br/>";
echo "Could Not Copy, Wrong Filetype (".$_FILES['image']['name'].")<br/>";
}
echo"</form>";
?>
I've also tried this but it won't upload to my folder called "upload"
<?
echo"
<form name='form1' method='post' action='' enctype='multipart/form-data'>
<input type='file' name='image'>
<br>
<input type='submit' name='submit' value='Submit'>";
echo $_FILES['image']['type'];
echo $_FILES['image']['name'];
if(isset( $submit ))
{
//If the Submitbutton was pressed do:
if ($_FILES['image']['type'] == "image/gif")
{
copy ($_FILES['image']['temp_name'], "upload/".$_FILES['image']['name'])
or die ("Could not copy");
}}
echo"</form>";
?>