Uploaded image in PHP not getting a file extension
<p>The file is uploaded and moved to the correct location, however the file becomes an unrecognized file type <code>(type="file")</code></p>

<p>Here is my script: </p>

<pre><code>//choose name for picture
$__img_name = "";
$query = "SELECT MAX(number) FROM post";
$stmt = $con-&gt;prepare($query);
$stmt-&gt;execute();
$stmt-&gt;bind_result($number);
$rows = $stmt-&gt;num_rows;
if($rows &gt; 0){
    $__img_name = $number;
} else{
    $__img_name = 1;
}

//moving file to specific place
$__route = '../app/images/uploads/';
$validextensions = array("jpeg", "jpg", "png");
$temp = explode(".", $_FILES["image"]["name"]);
$extension = end($temp);
if ((($_FILES["image"]["type"] == "image/jpeg")
    || ($_FILES["image"]["type"] == "image/jpg")
    || ($_FILES["image"]["type"] == "image/png"))
    &amp;&amp; in_array($extension, $validextensions)
) {
    move_uploaded_file($_FILES['image']['tmp_name'], $__route . $__img_name . $extension);
}
</code></pre>

<p>When I <code>print_r()</code> the <code>$_FILES</code> object, here is the output:</p>

<pre><code>array (size=1)
  'image' =&gt; 
    array (size=5)
      'name' =&gt; string 'braum_poro_by_proxy_oq-d7i83tv.png' (length=34)
      'type' =&gt; string 'image/png' (length=9)
      'tmp_name' =&gt; string 'C:\wamp\tmp\phpC09C.tmp' (length=23)
      'error' =&gt; int 0
      'size' =&gt; int 265229
</code></pre>

<p>What is causing the file to become unrecognizable?</p>