error messages

Hello all - just starting with CS community edition. When adding a product image I get this error message:

'It is not allowed to create/upload/rename files of the application/octet-stream MIME type.'

I have no idea what this means or how to get around it. I tried all 3 choices 'local' 'server' and 'url' to get an image to load - same message. The image is a standard jpeg and is located in /images/product/0 folder.

Any ideas?

Thanx

Same problem … and the changes mentioned in earlier post to fn.fs.php are incorprfated into the latest version download.

Hello centaur,



Thank you for your message. I apologize for your inconvenience in this matter.



It seems that the problem occurs because of a well-known issue in the current CS-Cart version. In order to resolve it, you should replace the following part of the code:


if (!is_array($filtered[$id]) || !empty($filtered[$id]['path']) && in_array(mime_content_type($filtered[$id]['path']), Registry::get('config.forbidden_mime_types'))) {

with this one:


if (!empty($filtered) && (!is_array($filtered[$id]) || !empty($filtered[$id]['path']) && in_array(fn_get_mime_content_type($filtered[$id]['path']), Registry::get('config.forbidden_mime_types')))) {

this one:


$mime = mime_content_type($filtered[$id]['path']);

with this one:


$mime = fn_get_mime_content_type($filtered[$id]['path']);

and add the following part of the code:


function fn_get_mime_content_type($filename)
{
if (class_exists('finfo')) {
$finfo_handler = finfo_open(FILEINFO_MIME);
$type = @finfo_file($finfo_handler, $filename);
list($type) = explode(';', $type);
finfo_close($finfo_handler);
} elseif (function_exists('mime_content_type')) {
$type = mime_content_type($filename);
} else {
if (strpos(basename($filename), '.') !== false) {
$type = fn_get_file_type(basename($filename));
} else {
$type = 'text/plain';
}
}

return $type;
}


above this one:


?>

in the “fn.fs.php” file located in the “core” directory of your CS-Cart installation.



If it does not help you, please try adding the following line of the code:


'tmp' => 'text/plain',

below this one:


'txt' => 'text/plain',

in the same file.



Please check it.





Pavel Zyukin

CS-Cart Support team

I just downloaded this version yesterday 2.2.3 Professional and I have the same problem. I created options for product and when I go to upload images for the options I get application/octet-stream MIME type. I checked the fn.fs file and its exactly how you told others to change. It was already fixed by you guys before I downloaded it so what going on?



The only part missing is this 'tmp' => 'text/plain', that is no where to be found on the page and your instructions to add it dont make sense.