Mime Types

Help: Uploading MP3s on WordPress doesn’t work

Monday, April 30th, 2012 | Business | No Comments

WordPressToday I ran into a minor issue with WordPress.

When uploading an MP3 file (in my case, although I’m sure many other file types) — I was getting an “HTTP Error” or “Internal Server Error” depending on how I uploaded the file.  The file wasn’t even that big, just a 150K test file.

There were 2 things that had to happen..

Add an MP3 Mime Type

Out of the box, WordPress doesn’t want you to upload an MP3 file to the Media Library.  You have to add it.

You can do this by using the “upload_mimes” hook in your functions.php file:

function addMimeTypes($mimes) {
    $newmimes = array_merge($mimes, array(
        'mp3' => 'audio/mpeg'
    ));
    return $newmimes;
}
add_filter('upload_mimes', 'addMimeTypes');

Disable FastCGI

Yes, unfortunately FastCGI use of PHP was causing me to have problems so I had to switch back to PHP being run as an Apache Module.

To do this, you’ll have to find out per your hosting provider how to do this.  I’m at Media Temple and it was pretty easy.

Keep in mind that FastCGI lowers your memory usage, and disabling it may have other negative effects.

Tags: , , , , , , ,


Please share, it makes me happy:

Subscribe to Email Alerts

Follow Me

Follow seangw on twitter

Archives

Categories

prestashop theme

virtuemart template