We wanted to upload some .bib and .tex files to one of our blogs. But, we got this error message:
“Sorry, this file type is not permitted for security reasons.”
The solution was:
In the functions.php file in the theme directory used by the Blog:
cd /var/www/wordpress/wp-content/themes/thebloggstheme/
edited the file:
vim functions.php
and added this php function to the functions.php file:
[php]function my_myme_types($mime_types){
$mime_types[‘bib’] = ‘text/plain’; // bib extension
$mime_types[‘tex’] = ‘text/plain’; // tex extension
$mime_types[‘txt’] = ‘text/plain’; // txt extension
return $mime_types; }
add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);[/php]
In addition to this:
Network Admin -> Dashboard -> Settings
In the “Upload file types”:
add:
bib tex txt
Then it was possible to upload these files to the Blog.
References:
One response
Unfortunately, I could only make this implementation in one (1) theme. I tried another themes as well, and it didn’t work.
The challenge of uploading files is still unsolved.
Another way of adding “docs” (MS word, excel, Google docs), could be solved by embedding them instead. See my post about embedding MS Excel spreadsheet from MS Skydrive.