class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
more info about the class
if($_FILES) { include("class.upload.php"); $handle = new upload($_FILES['image']); if ($handle->uploaded) { $handle->process($dir); $handle->allowed = array("image/*"); $handle->forbidden = array("application/*","text/*"); if ($handle->processed) { echo 'Imagem enviada!'; $handle->clean(); } else { echo 'error : ' . $handle->error; } } }
I've been used this code:
But i can upload any mime type. What's the problem?