you have to go to the file_process_upload handler
But first replace the get_mime_type function with this
Code:
function get_mime_type($filename)
{
// parse file to get extension
file_upload_printdebug("In Get_Mime_Type function");
file_upload_printdebug("filename = ".$filename);
$extension = substr($filename,strrpos($filename,'.'));
file_upload_printdebug("sourceFile = ".$extension);
//check extension among known types
switch($extension)
{
case '.xls':
case '.xla':
case '.xlc':
case '.xlm':
case '.xlt':
case '.xlw':
return 'application/excel';
break;
case '.doc':
case '.dot':
return 'application/msword';
break;
case '.pot':
case '.pps':
case '.ppt':
return 'application/vnd.ms-powerpoint';
break;
case '.vsd':
case '.vst':
case '.vsw':
return 'application/x-visio';
break;
case '.psd':
return 'applicatioin/octet-stream';
break;
case '.pdf':
return 'application/pdf';
break;
case '.eps':
return 'application/postscript';
break;
case '.ra':
case '.ram':
return 'application/vnd.rn-realaudio';
break;
case '.rm':
return 'application/vnd.rn-realmedia';
break;
case '.zip':
case '.gz':
case '.rar':
return 'application/x-gzip';
break;
case '.tgz':
case '.gtar':
case '.tgz':
return 'application/x-compressed';
break;
case '.swf':
return 'application/x-shockwave-flash';
break;
case '.avi':
return 'application/x-troff-msvideo';
break;
case '.mpg':
case '.mp3':
case '.mp4':
case '.mp2':
case '.mpeg':
return 'application/mpeg';
break;
case '.mov':
return 'video/quicktime';
break;
case '.fla':
return 'fla';
break;
case '.jpg':
case '.jpe':
case '.jpeg':
return 'image/jpg';
break;
case '.bmp':
return 'image/bmp';
break;
case '.gif':
return 'image/gif';
break;
case '.png':
return 'image/png';
break;
case '.tiff':
return 'image/tiff';
break;
case '.htm':
case '.html':
return 'text/html';
break;
case '.txt':
return 'text/plain';
break;
case '.wav':
case '.aud':
return 'audio/wav';
break;
}
}
Any time you add a new mime type you must add it hear the code is striaght forward
Now go to file_upload_process handler
Code:
$allowedMimeTypes = array(
'application/pdf',
'application/x-compressed',
'application/x-gzip',
'application/x-gzip',
'application/excel',
'application/msword',
'application/vnd.ms-powerpoint',
'text/html',
'text/plain',
'application/x-visio',
'applicatioin/octet-stream',
'application/postscript',
'application/vnd.rn-realaudio',
'application/vnd.rn-realmedia',
'application/mpeg',
'application/x-shockwave-flash',
'video/quicktime',
'fla',
'image/tiff',
'image/jpg',
'image/bmp',
'image/gif',
'image/png',
'application/x-troff-msvideo',
'audio/wav',
);
Replace your array with the one above it should then work.