Below is the php code to restrict the file uploads for a particular type of files. As an example, I'm showing all the extension types in the "Allowed extensions" variable.
<?php
$allowedExtensions = array("txt","csv","htm","html","xml",
"css","doc","xls","rtf","ppt","pdf","swf","flv","avi",
"wmv","mov","jpg","jpeg","gif","png");
if ($_FILES['upload_file']['tmp_name'] > '') {
if (!in_array(end(explode(".",
strtolower($_FILES['upload_file']['name']))),
$allowedExtensions)) {
die($_FILES['upload_file']['name'].' is an invalid file type!<br/>'.
'<a href="javascript:history.go(-1);">'.
'<< Go Back</a>');
}
}