Please see my private messaging with ratzybaby regarding this issue:Re: attachment problem
--------------------------------------------------------------------------------
Thank you for your spending your time even though you are not part of the dev team..
i ve changed the directory of the mime_magic but still the problem was not solved.. i am going to tweak the php function this my last resort but the bad thing is that i am not so familiar with php...
Thank you very much...
Originally Posted by rosali
I have examined the mail you sent me with the msword attachment. The content type is text/plain while it should be application/msword.
This means that RoundCube does not detect the correct mime type of the attachment when uploading the file. Possible reasons are:
#1
main.inc.php
// mime magic database
$rcmail_config['mime_magic'] = '/usr/share/misc/magic';
... does not point to mime magic database (look into your PHP folder where it is ...)
#2
./program/include/rcube_shared.inc ::: function rc_mime_content_type
/**
* A method to guess the mime_type of an attachment.
*
* @param string $path Path to the file.
* @param string $failover Mime type supplied for failover.
*
* @return string
* @author Till Klampaeckel
* @see [url=http://de2.php.net/manual/en/ref.fileinfo.php]PHP: Fileinfo Functions - Manual[/url]
* @see [url=http://de2.php.net/mime_content_type]PHP: mime_content_type - Manual[/url]
*/
function rc_mime_content_type($path, $failover = 'application/octet-stream')
{
$mime_type = null;
$mime_magic = rcmail::get_instance()->config->get('mime_magic');
if (!extension_loaded('fileinfo')) {
@dl('fileinfo.' . PHP_SHLIB_SUFFIX);
}
if (function_exists('finfo_open')) {
if ($finfo = finfo_open(FILEINFO_MIME, $mime_magic)) {
$mime_type = finfo_file($finfo, $path);
finfo_close($finfo);
}
}
if (!$mime_type && function_exists('mime_content_type')) {
$mime_type = mime_content_type($path);
}
if (!$mime_type) {
$mime_type = $failover;
}
return $mime_type;
}
If this function still fails after correcting the mime magic path, there is something wrong in your PHP setup regarding the PHP functions "finfo_open" and/or "mime_content_type". Please refer to PHP: Hypertext Preprocessor.
For the case you can't get it working by providing a proper PHP setup, then modify the function rc_mime_type to detect the mime_type from the informations in the $_FILES array. This is only a workaround, because $_FILES array detects the mime type from the file extension without scanning the file itself. So the mime type could be faked (upload of arbitary code as text/plain to force inline display).
Sorry, I can't help more than that. I'm not here to tweak your PHP setup.
Regards,
Roland
P.S.: I'm not a member of the dev crew. If you seem to be stumped please address the issue @ trac.roundcube.net (ticket or support mailing list) providing the informations I gave you regarding the issue. Mime type detecting has been changed serveral times due to insufficent PHP setups.