• Resolved wpyb

    (@wpyb)


    Trying to upload files with extension “.tex” fails with the error: “Sorry, this file type is not permitted for security reasons.”

    Why is this a security issue? Is it possible to allow the upload in case “tex” is added to the upload file types in network settings?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moving to How-To and Troubleshooting.

    It’s not really .tex files as much as “only these files types by default” sort of thing. It is to limit the uploading of files that can be harmful.

    Is it possible to allow the upload in case “tex” is added to the upload file types in network settings?

    Are you using multisite? If so then this should work.

    https://your-url-here/wp-admin/network/settings.php

    And add the file extension text to the Upload file types list.

    Thread Starter wpyb

    (@wpyb)

    Yes, I use multisite and I already tried that workaround but it doesn’t work for tex files.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Huh. That’s odd and should have worked. I’m going to move this topic to Multisite to see if someone can chime in there.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You have to add it like this:

    // Mimes
    add_filter('upload_mimes', 'add_custom_upload_mimes');
    function add_custom_upload_mimes($existing_mimes){
    	$existing_mimes['epub'] = 'application/epub+zip'; //allow epub files
    	$existing_mimes['webm'] = 'video/webm'; //allow epub file
    	return $existing_mimes;
    }

    Adjust for whatever a TEX is ??

    Thread Starter wpyb

    (@wpyb)

    It works, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Allow upload of tex files’ is closed to new replies.