Call to undefined function mime_content_type()

Hi ,

I created a Person Form in Campaigns module . Created successfully . But when i tried to download it , got the below error .

Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/testsite/public_html/download.php:180 Stack trace: #0 /home/testsite/public_html/include/MVC/Controller/SugarController.php(1007): require_once() #1 /home/testsite/public_html/include/MVC/Controller/SugarController.php(458): SugarController->handleEntryPoint() #2 /home/testsite/public_html/include/MVC/Controller/SugarController.php(366): SugarController->process() #3 /home/testsite/public_html/include/MVC/SugarApplication.php(108): SugarController->execute() #4 /home/testsite/public_html/index.php(53): SugarApplication->execute() #5 {main} thrown in /home/testsite/public_html/download.php on line 180

when i browsed on this error got a solution that to install this extension . I am using PHP 7 .

Adding the extensions to cpanel in live , is it safe … As it is shared host , does it affects other php projects .

When i executed phpinfo found something about mime_type . below
default_mimetype - text/html
mbstring.http_output_conv_mimetypes - ^(text/|application/xhtml+xml)

First of all, what is your version of SuiteCRM?

Have a look at some of these issues, you might find some clues:

https://github.com/salesagility/SuiteCRM/search?q=mime_content_type&type=Issues&utf8=✓

Thank you for the reply …

Suite crm 7.9.1

Sugar version 6.5.24

Sure i will go through the link

Hi,

Mime_content_type error . Suite crm 7.9.1

Found some solution for the above error i.e

“change download.php at root. replace it with finfo_file”

How to replace it with finfo_file at the root . Dont have idea on this please help …

Any suggestions…??

  1. Enable the extension in cpanel, if possible;

  2. If not, enable it in php.ini, as explained here: https://github.com/salesagility/SuiteCRM/issues/1863

  3. If it still doesn’t work, replace your code with the function chris001 provides in that same link.

1 Like

This can be fix by remove or comment this function. Just comment below lines in download.php in root of your suitecrm.
$mime_type = mime_content_type($local_location);
if ($mime_type == null || $mime_type == ‘’) {
$mime_type = ‘application/octet-stream’;
}

And add this line
$mime_type = ‘application/octet-stream’;

It will work.

1 Like

Old topic but thanks for rounding it off, if your confident this is fix then a GitHub PR would be great!