- This topic has 11 replies, 4 voices, and was last updated 10 months, 3 weeks ago by
Tahasin.
Hello! How are you?
I’m getting the following error when trying to upload a file via WPDM. This error does not accour when uploading via default WP Media
PHP Fatal error: Uncaught TypeError: finfo_close(): Argument #1 ($finfo) must be of type resource, finfo given in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php:991
Stack trace:
#0 /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php(991): finfo_close()
#1 /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php(1078): WPDM\__\FileSystem::getMimeType()
#2 /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php(162): WPDM\__\FileSystem::validateUploadMimeType()
#3 /public_html/wp-includes/class-wp-hook.php(324): WPDM\Admin\Menu\Packages->uploadFile()
#4 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#5 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /public_html/wp-admin/admin-ajax.php(192): do_action()
#7 {main}
thrown in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php on line 991
The problem seems to be the finfo_close($finfo) command in line 991 of /wp-content/plugins/download-manager/src/__/FileSystem.php
I have commented it and it worked normally
Hello,
I hope this message finds you well. I’m glad to hear that you have successfully identified the issue.
If you have any further questions or require additional assistance, please do not hesitate to reach out.
Regards
Thanks for the reply!
Just a suggestion — since this issue caused a fatal error and was fixed by removing a single line in a plugin file, it might be worth reviewing this in the plugin code so that other users don’t run into the same problem.
Would be great to see it fixed in a future update.
Thanks again!
Are you using the latest version of Download Manager? If yes, kindly use this hook add_filter("wpdm_is_valid_mime_type", '__return_true'); in your theme’s function.php file and let me know if the problem persists.
Regards
I get this error, and your filter didn’t help, do you have any other ideas?
[27-Apr-2025 00:05:23 UTC] PHP Fatal error: Uncaught Error: Class “finfo” not found in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php:989
Stack trace:
#0 /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php(1078): WPDM\__\FileSystem::getMimeType(‘/…’)
#1 /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php(212): WPDM\__\FileSystem::validateUploadMimeType(‘/…’, ‘hydro-one-outag…’)
#2 /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php(159): WPDM\Admin\Menu\Packages->chunkUploadFile(‘/…’)
#3 /public_html/wp-includes/class-wp-hook.php(324): WPDM\Admin\Menu\Packages->uploadFile(”)
#4 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)
#5 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /public_html/wp-admin/admin-ajax.php(192): do_action(‘wp_ajax_wpdm_ad…’)
#7 {main}
thrown in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php on line 989
In case it helps in troublshooting, if I remove this line from the .htaccess file:
AddHandler application/x-httpd-ea-php83___lsphp .php .php8 .phtml
The Download Manager works fine. But this line is generated automatically by cPanel so it gets added back, see below how it looks in the .htaccess:
# php — BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php83___lsphp .php .php8 .phtml
</IfModule>
# php — END cPanel-generated handler, do not edit
Thanks for sharing the information, we are checking the issue and will give you an update shortly.
Regards
Well you replied to me on another support entry. I guess this is not a fix then. Is the syntax correct? All my other functions use single quotes not double. I am not knowledgeable in php.
Where’s the old version so that we can roll back??????????
You must be logged in to reply to this topic.