Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX OpenLab Support

Public Group active 1 year, 1 month ago

Have a question about Commons In A Box OpenLab, our new platform for open learning? Join the group and post your question here. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

How to add an allowed file type

  • This topic has 12 replies, 3 voices, and was last updated 4 years, 2 months ago by Ryan Seslow.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • February 22, 2021 at 3:25 pm #8822
    S.G.
    Participant

    Our developer went to network settings and added tex to the uploaded file types, but when we tested this in a sub-site media library, by uploading a LaTeX file, we got the same error message (“this file is not permitted due to security reasons”). We believe we are missing a final step–do you know what it is?

    Thank you!

    February 22, 2021 at 3:55 pm #8823
    Ryan Seslow
    Participant

    Hi Syelle! Thanks for posting this, can you attach the LaTeX file here,

    Have you posted this file formant in the past with out issues?

    Thanks!

    Ryan

    February 22, 2021 at 4:10 pm #8824
    S.G.
    Participant

    Thanks, Ryan! Yes, I’ve tested with this file before, successfully, but years ago. Let us know what you think!

    February 22, 2021 at 5:22 pm #8825
    Ryan Seslow
    Participant

    OK, by default the WP media library only allows a few file format types (for security purposes) the most common are –

    • Images like .png, .gif, .jpg
    • Documents such as .doc, .xls, .ppt, .pdf
    • Audio like .wav, .mp3, .mp4
    • Video like .mpg, .mov, .wmv

    Im thinking, in the past you used a plug-in to add the LaTeX file or the plug-in converted it, Im going to take a peek at our plug-in roster and see if there is a compatible option, back soon 🙂

    February 22, 2021 at 9:20 pm #8826
    S.G.
    Participant

    Our allowed file types are:
    <p data-pm-slice=”1 1 []”>jpg jpeg png gif mov avi mpg 3gp 3g2 midi mid pdf doc ppt odt pptx docx pps ppsx xls xlsx key mp3 ogg m4a wav mp4 m4v webm ogv flv svg</p>
    <p data-pm-slice=”1 1 []”>I know that CityTech’s OL allows tex files, for example, though I don’t know if they use the plugin you mention…</p>
    <p data-pm-slice=”1 1 []”>I just tested a different LaTeX file, and it did not work; the setting we changed as Network Admin still seems to be missing a step.</p>

    February 22, 2021 at 10:13 pm #8827
    Ryan Seslow
    Participant

    Im digging into this and will be back in touch soon with info – in the meantime, did you already clear the web browser cache on your browser and also reboot the machine? The WordPress media library will reject uploads from cached pages. Its always worth a try. 🙂

    February 23, 2021 at 4:29 am #8828
    Ray
    Keymaster

    Hi Syelle and Ryan,

    Besides adding the latex and ltx file extensions to the uploaded file types, you also need to register the mime type for the file type with WordPress.

    You can do this with the following snippet in /wp-content/mu-plugins/:

    /**
     * Add custom items to mime type array for uploads
     */
    function my_mime_types( $types ) {
    	$types['latex']  = 'application/x-latex';
    	$types['ltx']    = 'application/x-latex';
    
    	return $types;
    }
    add_filter( 'upload_mimes', 'my_mime_types' );

    To find out how to add a mu-plugin, read this article:
    https://pantheon.io/docs/mu-plugin

    Hope that helps!

    February 23, 2021 at 9:05 am #8831
    Ryan Seslow
    Participant

    Thanks so much Ray! This is super helpful, as I was wondering how much ability one has to make those inputs themselves here versus reaching out to the DEV team to do it, or discovering an existing plug-in that converts things. Thank you!

    February 23, 2021 at 2:51 pm #8835
    Ray
    Keymaster

    Hi Ryan,

    You could give this plugin a shot:
    https://wordpress.org/plugins/wp-add-mime-types/

    I haven’t tested it though, but looks like it should work.

    February 24, 2021 at 9:37 am #8839
    S.G.
    Participant

    Thank you, Ray! I’ll let you know how it goes when Chris has a chance to implement your instructions.

    Just one question: You wrote “Besides adding the latex and ltx file extensions…”

    The LaTeX files I have are .tex file extension. Are we supposed to add tex and ltx?

    Thanks!

    February 24, 2021 at 1:50 pm #8840
    Ryan Seslow
    Participant

    Thanks Ray! Will ask Chris and Boone about this plug in as it could be a good option as well! Thanks!

    March 19, 2021 at 7:24 pm #8850
    S.G.
    Participant

    Hi Ray,

    We tried the mu- plugin but it did not work! The file types showed in list of allowed mime types, but we could not upload LaTeX files.
    We then installed your recommended plugin (wp-add-mime-types) and that did work!

    March 19, 2021 at 8:14 pm #8851
    Ryan Seslow
    Participant

    Happy to read this!

  • Author
    Posts
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX OpenLab Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 22
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register