You can upload files in documents and change company logo only if you are using php 5.5
In case you use php 5.4 “in my case v5.4.45” you will get this error
Fatal error: Call to undefined function mime_content_type() in /home/vtigerdemo/public_html/vtigerdemo/modules/Settings/Vtiger/actions/CompanyDetailsSave.php on line 31
@prasad i am new to vtiger and php, how can i turn on it. I tried something but i could not success. :)
I also reinstalled software but still same error exists.
Fatal error: Call to undefined function mime_content_type() in /home/vtiger/public_html/modules/Settings/Vtiger/actions/CompanyDetailsSave.php on line 31
Upload file in documents module
Fatal error: Call to undefined function mime_content_type() in /home/vtiger/public_html/data/CRMEntity.php on line 142
Uploading image in Products Module
Fatal error: Call to undefined function mime_content_type() in /home/vtiger/public_html/data/CRMEntity.php on line 142
@robert.heinze - file upload could have failed. Can you log the details to see more details before line 595 (error_log(var_export($file_details, true));)?
PHP Warning: mime_content_type(/tmp/phptTmdWw): failed to open stream: No such file or directory in vtlib/Vtiger/Functions.php on line 595, referer: /index.php?module=Products&view=Edit&record=10422
PHP Warning: file_get_contents(/tmp/phptTmdWw): failed to open stream: No such file or directory in vtlib/Vtiger/Functions.php on line 602, referer: /index.php?module=Products&view=Edit&record=10422
data/CRMEntity.php
//get the file path inwhich folder we want to upload the file
$upload_file_path = decideFilePath();
//upload the file in server
upload_status = move_uploaded_file(filetmp_name, $upload_file_path . $current_id . "_" . $binFile);
save_file = 'true'; //only images are allowed for these modules if (module == 'Contacts' || $module == 'Products') {
save_file = validateImageFile(file_details);
File is already moved to /storage when validateImageFile is called with the old file path in /tmp.
move_uploaded_file needs to be called after validateImageFile (and, perhaps, only if it returns true).
In case of issue with file uploading
{"success":false,"error":{"code":"mime_magic or fileinfo extension required.","message":"mime_magic or fileinfo extension required."}}
mime_magic or fileinfo not enabled , use pathinfo get file type
Changes I have made
crm/include/utils/VtlibUtils.php
Line no 726 added a new Line imageFileType = pathinfo(filename,PATHINFO_EXTENSION);
Beginning of the function
Add the above line inside function vtlib_mime_content_type at very Beginning of the function
crm/vtlib/Vtiger/Functions.php