inadmissible

WordPress upload file type security restrictions

October 24th, 2006

I just posted a little article on my WordPress blog about the new release of my Open all links extension for Thunderbird. I tried to attach a XPI file to the article, but I got the error message: File type does not meet security guidelines.

Via a topic on the WordPress support forum I found Peter Westwood’s pjw-mime-config WordPress Plugin which allows you to manage the mime-types supported by the inline uploader. Adding the file extension xpi with the mime type application/x-xpinstall did the trick.

Entry Filed under: WordPress

6 Comments Add your own

  • 1. Darren  |  February 14th, 2007 at 6:12 am

    You could add mime types to the functions.php file in wp-includes directory at about line (1069). You wouldn’t need php skills to do this either, pretty much copy and paste the code for the other mime types listed then change the copied type to the type you like. You can find good resources for mime types on w3schools or mozdev.

  • 2. Kristof  |  February 14th, 2007 at 7:58 am

    Hi Darren

    Thanks for the tip.

    This is a possible fix, but it doesn’t make upgrading easier. You will have to backup your changes and apply them again after upgrading.

    To my opinion, the pjw-mime-config is a more robust solution.

  • 3. Darren  |  February 14th, 2007 at 11:27 am

    Very true. I just try and stay away from alot of plugins. I find some plugins are huge and have alot of files, which I don’t like, but I can see the problem there. Although it isn’t too hard to just go back in and add them again after an upgrade. Cheers!

  • 4. mstormo  |  February 28th, 2007 at 4:20 pm

    Or you could add something like the following in your wp-config.php file:

    function add_some_mimes($mimes) {
    $ourMimes = array(
    ‘xpi’ => ‘application/x-xpinstall’,
    );
    return array_merge($mimes,$ourMimes);
    }
    add_filter(‘upload_mimes’,'add_some_mimes’);

  • 5. Louis Hearn  |  August 9th, 2007 at 12:58 pm

    Depending on the type of file you want to make available, you can also provide it as a ZIP file for download.

    WordPress wouldn’t let me upload Photoshop actions or setting files, but once they were in a ZIP file they uploaded, displayed in “Browse All” and downloaded fine.

    Obviously this is not a solution for things like videos that you want to display directly on your page, but for something like a Thunderbird extension it ought to do the trick.

  • 6. Long-term Memory » &hellip  |  January 5th, 2010 at 6:42 pm

    [...] bit of googling got me to Kristof Coomans’ blogpost which pointed me to the PJW Mime Config plugin. This plugin allows you to add custom file [...]

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

October 2006
M T W T F S S
« Aug   Nov »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Most Recent Posts