5

Using Suite crm 7.9.1 . newbie to suitecrm.

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)
Nkosi
  • 235,767
  • 35
  • 427
  • 472
bhavya
  • 195
  • 2
  • 2
  • 7

2 Answers2

22

You need to install fileinfo extension in order to use mime_content_type. In debian based system you can install it via apt: apt-get install php-mime-type

More info: http://php.net/manual/en/book.fileinfo.php

Karol Samborski
  • 2,757
  • 1
  • 11
  • 18
1

I was trying to get the mimeType of a file using mime_content_type() but it was not working.

Here this works for me:

$file = $request->file('FILE_NAME_IN_REQUEST');
$mimeType = $file->getClientmimeType();
Star
  • 3,222
  • 5
  • 32
  • 48
Imran_Developer
  • 343
  • 5
  • 13