Dealing with MIME types

Syllabus for Capstone I

agenda alt

Syllabus for Engineering Dynamics

Apparently, to get txt and m files to upload, you need to do the following:

add a function to functions.php (tucked away in local_install_dir/wordpress/wp-content/themes/my_current_theme/):

add_filter(‘upload_mimes’,'add_custom_mime_types’);
function add_custom_mime_types($mimes){
return array_merge($mimes,array (
‘ac3′ => ‘audio/ac3′,
‘mpa’ => ‘audio/MPA’,
‘flv’ => ‘video/x-flv’,
‘svg’ => ‘image/svg+xml’
));
}

and

add_filter(‘upload_mimes’,'remove_mime_types’);
function remove_mime_types($mimes){
unset( $mimes['mp4'] );
}

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.