【发布时间】:2012-10-03 15:46:00
【问题描述】:
使用时出于某种原因
$this->response->send_file($file_to_send, $file->hashed_name.'.'.$file->extension);
我收到这样的错误:
ErrorException [ Warning ]: mime_content_type() [<a href='function.mime-content-type'>function.mime-content-type</a>]: can only process string or stream arguments
SYSPATH/classes/kohana/file.php [52]
47 }
48
49 if (ini_get('mime_magic.magicfile') AND function_exists('mime_content_type'))
50 {
51 // The mime_content_type function is only useful with a magic file
52 return mime_content_type($filename);
53 }
Trace 显示由于某种原因,mime_content_type(arguments) 似乎是 bool FALSE。
但是我传递给send_file 普通字符串完整路径,例如/var/www/dev3/media_files/files/113b778d9751e7d1667b300557b6e8030ba1227e68ef9c4dd093a4cd79691f9d.png。
【问题讨论】:
标签: php kohana mime-types kohana-3.2