check image for malicious code and delete it
问题 How can I detect if an uploaded image has malicious code and delete it from the temp folder? code: $_FILES['file']['tmp_name'] as far as i know there is no way to stop it hitting the /tmp folder I read that i could use $file_data = getimagesize($_FILES['file']['tmp_name']); if(is_array($file_data) && strpos($file_data['mime'],'image') !== false) { echo "Image"; } but how reliable is that? 回答1: Try to resize uploaded image with function imagecopyresized . If it is resized success it means that