I am able to attach a file to a History or Document, but I am unable to retrieve it. When I click on the attached filename, a new browser page appears and tells me is currently unable to handle this request. HTTP ERROR 500.
This happened on 7.7.9, and it continues on 7.8.0 (having just upgraded).
I know that the attachments are being saved and loaded into SuiteCRM, because I can go into the native file system (Windows 10 Enterprise) on the server where SuiteCRM is installed and access the files that I saved. These are Word, PDF and other file types. They all load just fine from the native file system, but not from SuiteCRM.
Has anyone else run into this problem, and how did you solve it???
Ok, I found my issue. I’m running on PHP 7. The download.php (in the root of the crm installation) is calling a deprecated function – mime_content_type(). I updated the download.php file with the following code:
// Fix for issue 1506 and issue 1304 : IE11 and Microsoft Edge cannot display generic 'application/octet-stream' (which is defined as "arbitrary binary data" in RFC 2046).
//added this manually
if (!function_exists('mime_content_type'))
{
function mime_content_type($f)
{
return trim(exec('file -bi ' . escapeshellarg($f)));
}
}
//end of added content
$mime_type = mime_content_type($local_location);
if($mime_type == null || $mime_type == '') {
$mime_type = 'application/octet-stream';
}