Allow Extensions

$allowedExtensions = array("pdf","doc","docx","txt","rtf");
$tmp_nme = $_FILES['resume']['tmp_name'];
$nme = $_FILES['resume']['name'];
if(in_array(end(explode(".",strtolower($nme))),$allowedExtensions)){
$ipath= $path."/".$nme;
copy($tmp_nme, $ipath);
chmod($ipath, 0777);
}