title: check image for malicious code and delete it
body: <p>How can I detect if an uploaded image has malicious code and delete it from the temp folder?</p>
  
  <p>code: </p>
  
  <pre><code>$_FILES['file']['tmp_name']
  </code></pre>
  
  <p>as far as i know there is no way to stop it hitting the /tmp folder</p>
  
  <p>I read that i could use </p>
  
  <pre><code>$file_data = getimagesize($_FILES['file']['tmp_name']);        
  if(is_array($file_data) &amp;&amp; strpos($file_data['mime'],'image') !== false)
  {
      echo "Image";
  }  
  </code></pre>
  
  <p>but how reliable is that?</p>