you will have to tweek the script but this should help you
--
-- Table structure for table `mime_types`
--
DROP TABLE IF EXISTS `mime_types`;
CREATE TABLE IF NOT EXISTS `mime_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`extension` varchar(5) NOT NULL,
`type` varchar(100) NOT NULL,
`aud_vid` int(11) NOT NULL,
`access_type` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ;
--
-- Dumping data for table `mime_types`
--
INSERT INTO `mime_types` (`id`, `extension`, `type`, `aud_vid`, `access_type`) VALUES
(1, '.au', 'audio/basic', 1, 1),
(2, '.avi', 'application/x-troff-msvideo', 1, 0),
(3, '.bm', 'image/bmp', 0, 1),
(4, '.bmp', 'image/bmp', 0, 1),
(5, '.doc', 'application/msword', 0, 0),
(6, '.flp', 'application/FruityLoops Project', 1, 1),
(7, '.gif', 'image/gif', 0, 1),
(8, '.gz', 'application/x-gzip', 0, 0),
(9, '.gzip', 'application/x-gzip', 0, 0),
(10, '.jpe', 'image/jpeg', 0, 1),
(11, '.jpeg', 'image/jpeg', 0, 1),
(12, '.jpg', 'image/jpeg', 0, 1),
(13, '.kar', 'audio/midi', 1, 1),
(14, '.mid', 'audio/midi', 1, 1),
(15, '.mov', 'video/quicktime', 1, 0),
(16, '.mp2', 'audio/mpeg', 1, 1),
(17, '.mp3', 'audio/mpeg3', 1, 1),
(18, '.mpa', 'audio/mpeg', 1, 1),
(19, '.mpe', 'video/mpeg', 1, 1),
(20, '.mpeg', 'video/mpeg', 1, 0),
(21, '.mpg', 'video/mpeg', 1, 0),
(22, '.pdf', 'application/pdf', 0, 0),
(23, '.png', 'image/png', 0, 1),
(24, '.ppt', 'application/mspowerpoint', 0, 0),
(25, '.qt', 'video/quicktime', 1, 0),
(26, '.ra', 'audio/x-pn-realaudio', 1, 1),
(27, '.ram', 'audio/x-pn-realaudio', 1, 1),
(28, '.rmi', 'audio/mid', 1, 1),
(29, '.rtx', 'application/rtf', 0, 0),
(30, '.swf', 'application/x-shockwave-flash', 0, 0),
(31, '.tif', 'image/tiff', 0, 1),
(32, '.tiff', 'image/tiff', 0, 1),
(33, '.txt', 'text/plain', 0, 0),
(34, '.wav', 'audio/wav', 1, 1),
(35, '.wma', 'audio/x-ms-wma', 1, 1),
(36, '.wmv', 'video/x-ms-wmv', 1, 0),
(37, '.xls', 'application/excel', 0, 0),
(38, '.zip', 'application/zip', 0, 0),
(39, '.mp3', 'audio/x-mpeg', 1, 1),
(40, '.ppt', 'application/vnd.ms-powerpoint', 0, 0);
//Check to see if MIME is authorized
$this->type = $_FILES['file_to_upload']['type'];
$this->query_string = "SELECT * FROM mime_types WHERE type='$this->type'";
$this->query = mysql_query($this->query_string);
$this->num_rows = mysql_num_rows($this->query);
if($this->num_rows == "")
{
$this->file_form($UserInput);
echo "
File type not allowed!
or
You did not select a file to upload!
Contact support! or $this->goback
";
$this->Error == true;
exit;
}
else
{
$this->mime_info = mysql_fetch_assoc($this->query);
$UserInput['file_access'] = $this->mime_info['access_type'];
}