-
AuthorPosts
-
January 17, 2017 at 8:39 pm #734964
Being using Enfold on site for about 3 years. Currently running 3.8.1. Within the last couple weeks or so, no longer able to upload PDFs: “Sorry, this file type is not permitted for security reasons.” File sizes are well under maximum. Also in Media, found this Warning: finfo_open() expects parameter 1 to be long, string given in /hsphere/local/home/XXXXXXX/wp-includes/functions.php on line 2325 Warning ….. not valid file_info resource in XXXXX/functions.php on line 2326…”
I added ‘image/pdf’ => ‘pdf’ to the array, but that did not help, so I removed it again.
January 17, 2017 at 9:16 pm #734972Have you tried something like the function suggested here: http://www.wpbeginner.com/wp-tutorials/how-to-add-additional-file-types-to-be-uploaded-in-wordpress/
January 17, 2017 at 10:58 pm #735022Thank you for the link. I added this code to the functions.php file via the WP backend Editor:
<?php
/*
* Enfold Child theme functions file
*/function my_myme_types($mime_types){
$mime_types[‘pdf’] = ‘application/pdf’; //Adding pdf extension
return $mime_types;
}
add_filter(‘upload_mimes’, ‘my_myme_types’, 1, 1);?>
but am still getting this warning:
Warning: finfo_open() expects parameter 1 to be long, string given in /hsphere/local/XXX/wp-includes/functions.php on line 2325 Warning: finfo_file(): supplied argument is not a valid file_info resource in /hsphere/local/XXX/wp-includes/functions.php on line 2326 Warning: finfo_close(): supplied argument is not a valid file_info resource in /hsphere/local/XXX/wp-includes/functions.php on line 2327
Dismiss“XXX.pdf” has failed to upload.
Sorry, this file type is not permitted for security reasons.- This reply was modified 7 years, 10 months ago by umeworks.
January 17, 2017 at 11:12 pm #735024Can you check your server and see what version of PHP is installed?
January 18, 2017 at 1:41 am #7350635.2.17 version. I can ask my hosting to switch it to 5.3.29, 5.4.45 or 5.5.33 if you think that will help. Will await your advice.
January 18, 2017 at 1:51 am #735068According to this page (https://wordpress.org/about/requirements/) the minimum version is 5.2.4 or greater. Perhaps this is the issue.
Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.2.4+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.
January 18, 2017 at 2:44 am #735078Do you have a specific recommendation which of these I should upgrade to?
5.3.29, 5.4.45 or 5.5.33January 18, 2017 at 6:19 am #735127Sorry, I really don’t. You might ask your hosting company if you can change back and forth between the versions. If so, I would try 5.5.33 since it’s the latest and then downgrade if you have any issues.
January 18, 2017 at 7:09 am #735151Hi,
Thanks again for helping out @kevinmcgillivray :-)
Did you try upgrading the PHP version and did you have any luck with it @umeworks?
Best regards,
RikardJanuary 18, 2017 at 7:24 am #735158Happy to help, Rikard. I’m hoping to get an answer to one of my issues so I thought I’d help clear your plate a bit with some easy answers. :-D
January 18, 2017 at 10:35 pm #735567Updated to PHP 5.3 and now resolved. Thank you.
January 18, 2017 at 10:39 pm #735570That’s great! Glad it worked out for you.
January 20, 2017 at 9:16 am #736300Hi umeworks,
Glad that it’s fixed.
@kevinmcgillivray: Thanks for helping out. :)Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.