I am trying to upload tex files in my wordpress site. The methods I have tried and failed or the following. First of all the error I got is,
Sorry, this file type is not permitted for security reasons.
Tried Methods:
- Method 1:
Added the below line in wp-config.php
define('ALLOW_UNFILTERED_UPLOADS', true);
Which did not work.
- Method 2
Added the following codes which allows mime types in functions.php
// Adding Mime types
function my_myme_types( $mime_types ) {
$mime_types['svg'] = 'image/svg+xml'; // Adding .svg extension
$mime_types['json'] = 'application/json'; // Adding .json extension
$mime_types['tex'] = 'application/octet-stream'; // Adding .tex extension
return $mime_types;
}
add_filter( 'upload_mimes', 'my_myme_types');
which again did not help. I remember that only once the file got uploaded in local copy of the website which I dont know how?
- Method 3
Added the plugin WP Add Mime Types, thinking that I can try adding the mime type. But It already shows me that 'appliations/x-tex' is already added from the method 2.
None of the above method helped me to upload the .tex files. Note that pdf files are getting uploaded without any issue.
PS: I am using a form to upload files. You may check here . Any suggestions would be really helpful.