2012-10-03 7 views
1

와 send_file 할 수 없습니다내가이 같은 오류를 얻을 몇 가지 이유를 들어 Kohana 3.2

ErrorException [ Warning ]: mime_content_type() [<a href='function.mime-content-type'>function.mime-content-type</a>]: can only process string or stream arguments 

SYSPATH/클래스/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  } 

흔적은 어떤 이유로 bool FALSE 인 것 같습니다. mime_content_type(arguments) 그러나 send_file 일반 문자열의 전체 경로 인 /var/www/dev3/media_files/files/113b778d9751e7d1667b300557b6e8030ba1227e68ef9c4dd093a4cd79691f9d.png으로 전달합니다.

답변

1

내가 Kohana 시스템 파일을 검사했습니다 그리고 내가 옵션으로 수동으로 실시 MIME_TYPE를 전달할 수 있다는 밝혀졌다, 그래서 이것은 완벽하게 작동합니다 :

$this->response->send_file($file_to_send, $file->name.'.'.$file->extension, array('mime_type' => File::mime_by_ext($file->extension))); 

그러나, 표준 $this->response->send_file($file_to_send) 나를 위해 작동하지 않습니다.

관련 문제