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.
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
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.
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.
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:
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.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?
Ok. I checked the headers returned by your server and they are now fine:
I guess your PC has associated .reg files with a MP3 player though?
Ah, turned out I just had to clear the browser cache. It indeed works now. Thanks for all the help!
Pingback: Big IDEA » Blog Archive » Three helpful Wordpress plugins for web geeks