how to add new .webm mime types

i tried google but no success yet.

I am trying to upload .webm and .ogg video types in wordpress ( for html5 video ofcourse)
I am getting error like

Baki fula.webm” has failed to upload due to an error
Sorry, this file type is not permitted for security reasons.

tried plugins like

  1. PJW Mime Config
  2. AP Extended Mime Types

but doesnot seem to work either.
I am working locally with easyphp in windows 7 in wordpress 3.4.1.

Can anyone plase help me in solving this issue. Any help is appreciated

1 Answer
1

The WebM file format isn’t known to WordPress by default, you have to add it.

add_filter( 'upload_mimes', 'custom_mimes' );
function custom_mimes( $mimes ){
    $mimes['webm'] = 'video/webm';
    return $mimes;
}

The .ogg file format is known to WordPress as audio/ogg, if you’re wanting to do video with it, the correct extension is .ogv.

Leave a Comment