-
AuthorPosts
-
September 9, 2015 at 12:06 am #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!
September 9, 2015 at 12:59 am #500151Hi!
Refer to:
http://www.wpbeginner.com/wp-tutorials/how-to-add-additional-file-types-to-be-uploaded-in-wordpress/Cheers!
JosueSeptember 9, 2015 at 1:15 am #500158Hi – 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.
September 9, 2015 at 1:16 am #500160Can you paste the code you’re trying to use? are you using a child theme?
September 9, 2015 at 1:16 am #500161Alternatively, you could use this handy plugin:
https://wordpress.org/plugins/wp-extra-file-types/September 9, 2015 at 1:18 am #500162function 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);September 9, 2015 at 1:27 am #500165Try 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.
September 9, 2015 at 2:50 am #500168Hi – 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!
September 9, 2015 at 3:32 am #500172When 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
September 9, 2015 at 4:21 am #500176OK – 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
September 9, 2015 at 10:17 am #500275You are welcome John, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.
