Failure to upload documents

Hi All,

Setup:
I’ve installed SuiteCRM Version 7.11.20
That runs on Apache 2.4.48
With Php 7.3.28
On windows 10

I tried and succeeded adding a logo.
The file is in the default …/SuiteCRM/upload/

When I try to add a document to a contact for example, It fails with the below error:
(uploading 44kb jpeg file)


Notice : Undefined index: allowed_preview in C:\Apache24\htdocs\SuiteCRM\modules\Documents\Document.php on line 281

Warning : in_array() expects parameter 2 to be array, null given in C:\Apache24\htdocs\SuiteCRM\modules\Documents\Document.php on line 281

This is the line that fails:

The same happens to any type of file I try uploading, and for various sizes…
I cannot view the uploaded file, nor download. I get the below error:

Notice : Undefined index: allowed_preview in C:\Apache24\htdocs\SuiteCRM\modules\Documents\Document.php on line 281

Warning : in_array() expects parameter 2 to be array, null given in C:\Apache24\htdocs\SuiteCRM\modules\Documents\Document.php on line 281

Fatal error : Uncaught Error: Call to undefined function mime_content_type() in C:\Apache24\htdocs\SuiteCRM\download.php:198 Stack trace: #0 C:\Apache24\htdocs\SuiteCRM\include\MVC\Controller\SugarController.php(1029): require_once() #1 C:\Apache24\htdocs\SuiteCRM\include\MVC\Controller\SugarController.php(477): SugarController->handleEntryPoint() #2 C:\Apache24\htdocs\SuiteCRM\include\MVC\Controller\SugarController.php(373): SugarController->process() #3 C:\Apache24\htdocs\SuiteCRM\include\MVC\SugarApplication.php(113): SugarController->execute() #4 C:\Apache24\htdocs\SuiteCRM\index.php(52): SugarApplication->execute() #5 {main} thrown in C:\Apache24\htdocs\SuiteCRM\download.php on line 198

(Thanks in advance for any help here!)

Thank you Ashish!

Your solution works (uncomment from php.ini) and this issue is resolved as I now can add and view files
The error is still displayed but all work as expected

What was the solution? I don’t see it in the thread. What needs to be uncommented in php.ini?

@liero could you please explain what your solution was (“uncomment from php.ini”). I am experiencing the same symptoms you reported (although with SuiteCRM-7.12.4, PHP 8.0.15 and Apache/2.4.52 on FreeBSD). Thank you in advance. Dale

@dalescott Dale I found that my temp upload folder in php.ini had an error. Once fixed uploads worked fine. Can’t recall the exact variable but that may guide you. There is also a setting for large file temp uploads. Both of mine were wrong.

Thanks @markaz32. I’m glad you got your install working and thanks for the suggetions. I checked the …/uploads folder and saw my files were getting uploaded, so at least that much is working for me.

My symptoms are not exactly the same as liero, but hopefully he will respond with his solution (although I suspect he only neeeded to load the fileinfo module). I also created a new topic with more information in case someone recognises anything.

Cheers,
Dale

:point_up: this was the solution, it is in a post that was deleted for other reasons

2 Likes