The Codex explains here how you can change the allowed mime types, through the upload_mimes
filter.
If you mean a Matlab file with the .m
extension, then you could try the following plugin:
<?php
/**
* Plugin Name: Support Matlab (.m) uploads
* Description: Support uploads of Matlab .m files.
* Plugin URI: http://stackoverflow.com/a/27785139/2078474
* Author: birgire, Codex
* Version: 0.0.1
*/
add_filter('upload_mimes', 'custom_upload_mimes' );
function custom_upload_mimes ( $existing_mimes = array() )
{
// Add file extension 'extension' with mime type 'mime/type'
// $existing_mimes['extension'] = 'mime/type';
// ----------------------
// Your modifications:
// Support for .m files:
$existing_mimes['m'] = 'application/matlab';
// ----------------------
return $existing_mimes;
}
where you might have to adjust the mime part to your needs.