WordPress: ‘Sorry, this file type is not permitted for security reasons’ when uploading media
March 27, 2012 Comments
I’m currently writing an application that uses XSLT to change the output style of the data from XML to JSON and I needed the .xslt file hosted somewhere. Because I’m feeling lazy right now I figured I’d just upload the .xslt file to my WordPress blog and point my code there. I got the following error when I tried to upload it in the WordPress Media library:
Sorry, this file type is not permitted for security reasons.
If you have access to your WordPress application files, you can edit functions.php in /wordpress/wp-includes to allow the file extension. In my case I added this line in the get_allowed_mime_types() function:
'xml|xsl|xslt' => 'text/xml',