pjw-mime-config v0.90 released

A while ago I released a simple plugin which allows you to manage the mime-types supported by the WordPress inline-uploader. This plugin worked well for most people baring a issue with php shorttags which made it break some sites. However, some people requested an update to the plugin to support adding a large list of mime-types from a file. I am proud to announce that finally after many months of sitting there 95% finished I am ready to release this plugin update.


Here is the detailed list of changes since the previous version:

  • Added support for mime-types described in a file
  • Changed the plugin to initialise on the “init” hook rather than at include time
  • Added support for mime-types described in a file
  • Fixed the shorttags issues

As ever the plugin adds a new options page as Options … Mime-types which allows you to add/delete the extra mime-types.

screenshot of the plugins options page

By default the following extra mime-types are registered: audio/ac3, audio/MPA and video/x-flv.

The latest version of the plugin may be downloaded here: pjw-mime-config.0.90.zip

18 Responses to “pjw-mime-config v0.90 released”

  1. westi says:

    I tried deleting all MIME-config entries, and the file itself, and then upload the file again. It didn’t help. It’s still downloaded as an MP3 file. I also tried changing functions.php (to include “reg” with the text/plain formats), and uninstalling MIME-config before uploading again, but it seems to be completely broken. Any tips would be great.

    Ok. It sounds like your server is configured to return a mime-type of MP3 for .reg files and as such that is what is being returned.

    The list of mime-types in WordPress (and hence in the plugin) affects what you can upload to the server – it is effectively a whitelist of allowable file types – the mime-type info is stored along with the extension so as to be available when WordPress or a plugin wants to do something special based on mime-type – at present the only mime-types that WordPress does anything special with on presentation is images – where is extras the width and height to put into the generated html.

  2. Morty says:

    Are you sure that mp3 is reported by the server and not your mp3 player is assigned to text/plain or something like that? A link would help.

  3. l0b0 says:

    Sure, look at the bottom of this post. I’ve tried it on two machines now, and both detect it as MP3.

  4. westi says:

    Sure, look at the bottom of this post. I’ve tried it on two machines now, and both detect it as MP3.

    Yep appears as MP3 to me.

    Looking at the headers returned by your webserver – it is stating that it is MP3 so it looks like a server config issue I think:

    $ curl -I http://blog.l0b0.net/wp-content/uploads/2007/09/dvorak-keyboard-layout-at-login.reg
    HTTP/1.1 200 OK
    Date: Mon, 10 Sep 2007 18:24:39 GMT
    Server: Apache
    Last-Modified: Mon, 10 Sep 2007 14:04:24 GMT
    ETag: "248c6cd-886-77438a00"
    Accept-Ranges: bytes
    Content-Length: 2182
    Content-Type: audio/mpeg
    

    Interestingly, the unix file command (which helps identify file types) says this about the file – MPEG ADTS, layer I, v1, 160 kBits, 48 kHz, Stereo – I guess your server config maybe using file to determine the mime type automatically.

  5. l0b0 says:

    I’ve added the following lines to .htaccess:
    AddType text/plain .reg
    ForceType text/plain .reg
    AddType text/plain reg
    ForceType text/plain reg

    I’ve also downloaded the file, and re-set the encoding to ISO-8859-1. According to jEdit, it was set to “x-UTF-16LE-BOM”.

    Still doesn’t work. Any ideas where the MIME type is overridden?

  6. westi says:

    Ok. I checked the headers returned by your server and they are now fine:

    
     curl -I http://blog.l0b0.net/wp-content/uploads/2007/09/dvorak-keyboard-layout-at-login.reg
    HTTP/1.1 200 OK
    Date: Tue, 25 Sep 2007 10:36:05 GMT
    Server: Apache
    Last-Modified: Tue, 25 Sep 2007 09:30:35 GMT
    ETag: "248c6cd-491-63a384c0"
    Accept-Ranges: bytes
    Content-Length: 1169
    Content-Type: text/plain
    

    I guess your PC has associated .reg files with a MP3 player though?

  7. l0b0 says:

    Ah, turned out I just had to clear the browser cache. It indeed works now. Thanks for all the help!

  8. [...] Mime-config provides an interface for you to allow uploading of additional file types. [...]



d
go to dashboard
l
go to login
h
show/hide help
e
edit post/page
r
comment on post/page
m
go to moderate comments
esc
cancel
%d bloggers like this: