Can anyone see why Im lossing the image type when it's renamed !
Thanks
Chris
<?
session_start() ;
$n=$_FILES['user_file']['name'];
$type=$_FILES['user_file']['type'];
$size=$_FILES['user_file']['size'];
$time=time();
$n=$time;
$path="uploads\ \". $n;
$uploaded = $_SESSION['firsttimeuploa d'];
if ($uploaded == "ok")
{
if ($size <900000 && ereg("image", $type ))
{
move_uploaded_f ile($_FILES['user_file']['tmp_name']['type'],
$path);
$root= "http://uploads/";
$path2=$root . $n;
echo "<center>";
echo "<h3>Your Image : </h3><a href=$path2>$pa th2</a><br /><br />";
echo "<br>";
echo "<img src=$path2 border='1'></img>";
echo "<center>";
$fp=fopen("link s.text", "at");
fwrite($fp, $path2."\n");
fclose($fp);
session_destroy ();
}
}
else
{
echo "File all ready uploaded";
}
if ($size>900000)
{
echo "ERROR <br /the image size is too big";
}
if (!ereg("image", $type) )
{
echo "ERROR <br /the file is not image<br />";
}
?>
Comment