Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #500145

    I am trying to upload some custom filetypes through the Media Library. They have the extensions of ‘.hex’ and ‘.prf’. What code do I use and which file do I insert the code? Thanks!

    #500151
    #500158

    Hi – I tried this, but it doesn’t work. Using this method the website won’t load and shows an error on a white screen. I amy not be adding the correct information or inserting this in the wrong file, etc. Any other information you can provide? Thanks in advance.

    #500160

    Can you paste the code you’re trying to use? are you using a child theme?

    #500161

    Alternatively, you could use this handy plugin:
    https://wordpress.org/plugins/wp-extra-file-types/

    #500162

    function my_myme_types($mime_types){
    $mime_types[‘prf’] = ‘image/prf’; //Adding prf extension
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);

    #500165

    Try with this:

    function my_myme_types($mime_types){
    	$mime_types['prf'] = 'image/prf'; //Adding prf extension
    	return $mime_types;
    }
    add_filter('upload_mimes', 'my_myme_types', 1, 1);

    Copy the code from the forum reply, not from the mail notification.

    #500168

    Hi – I tried the plugin you suggested, but it doesn’t support my file type, so I’ll try the code you provided. It goes in the ‘functions.php’ file, right? Any particular location of the file? Also, I have looked at this, but I don’t see a difference. Can you enlighten me? Thanks again!

    #500172

    When I put this code at the end (or anyplace in the middle) of the ‘functions.php’ file it says:

    Parse error: syntax error, unexpected ‘}’ in /homepages/46/d397469458/htdocs/clickandbuilds/WordPress/MyCMS2/wp-includes/functions.php on line 5004

    #500176

    OK – I finally got it all worked out with the PlugIn that you suggested. Thank you for all of your help with this, I appreciate it!

    Thanks!

    John

    #500275

    You are welcome John, glad to help :)

    Regards,
    Josue

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.