For some reason I get the "your file is wrong" error when I run this. I'm trying to get it so that the values go to the database, and the image id goes to a folder on my server, so that I can recall the images when I want to see them on the homepage. Thanks

Code:
if (isset($_POST['upload'])) {
        if (((@$_FILES["image"]["type"]=="image/jpeg") || (@$_FILES["image"]["type"]=="image/png") || (@$_FILES["image"]["type"]=="image/jpg") || (@$_FILES["image"]["type"]=="image/gif"))&&(@$_FILES["image"]["size"] < 2097152)) //2 Megabytes
  {
   $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   $rand_dir_name = substr(str_shuffle($chars), 0, 15);
   mkdir("userdata/user_photos/$rand_dir_name");

   if (file_exists("photos/$rand_dir_name/".@$_FILES["image"]["name"]))
   {
    echo @$_FILES["image"]["name"]." Already exists";
   }
   else
   {
    move_uploaded_file(@$_FILES["image"]["tmp_name"],"photos/$rand_dir_name/".$_FILES["image"]["name"]);