Allow more filetype uploads

Wpsnipp – Adding this PHP code to your functions.php will allow you to define other file types you can upload to wordpress separating each file type by a vertical pipe.For some reason, WordPress uploader won’t let you upload some filetypes, such as Textmate’s .tmCommand. If you need to upload those files to your WordPress blog, here is a very nice snippet that will allow you to do it.

 

 

function addUploadMimes($mimes) {
$mimes = array_merge($mimes, array(
'tmbundle|tmCommand|tmDragCommand|tmSnippet|tmLanguage|tmPreferences' => 'application/octet-stream'
));
return $mimes;
}
add_filter('upload_mimes', 'addUploadMimes');

Be Sociable, Share!

Leave a comment